/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

.lknwp-filebrowser-public {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 100%;
}

.lknwp-search-container {
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
    padding: 20px;
}

.lknwp-search-box {
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    overflow: hidden;
    transition: all 0.3s ease;
    max-width: 500px;
    margin: 0 auto;
}

.lknwp-search-box:focus-within {
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.lknwp-search-box input {
    flex: 1;
    border: none !important;
    padding: 12px 20px !important;
    font-size: 16px;
    outline: none;
    background: transparent;
}

.lknwp-search-box button {
    background: #007cba;
    color: #fff;
    border: none;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 16px;
}

.lknwp-search-box button:hover {
    background: #005a87;
}

#lknwp-clear-search {
    background: #dc3545 !important;
}

#lknwp-clear-search:hover {
    background: #c82333 !important;
}

.lknwp-breadcrumb-public {
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
    padding: 15px 20px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.lknwp-breadcrumb-public .breadcrumb-item {
    color: #007cba;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.3s ease;
}

.lknwp-breadcrumb-public .breadcrumb-item:hover {
    color: #005a87;
    text-decoration: underline;
}

.lknwp-breadcrumb-public .breadcrumb-separator {
    margin: 0 8px;
    color: #6c757d;
}

.lknwp-layout-controls {
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
    padding: 10px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 5px;
}

.layout-btn {
    background: #fff;
    border: 1px solid #e1e5e9;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    color: #495057;
}

.layout-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.layout-btn.active {
    background: #007cba;
    border-color: #007cba;
    color: #fff;
}

.lknwp-filebrowser-content {
    height: 100%;
    padding: 20px;
}

/* Grid Layout */
.lknwp-filebrowser-content.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.lknwp-filebrowser-content.grid .content-item {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    justify-content: center;
    height: 100%;
    max-height: 220px;
    box-sizing: border-box;
}

.lknwp-filebrowser-content.grid .content-item:hover {
    border-color: #007cba;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.15);
    transform: translateY(-2px);
}

.lknwp-filebrowser-content.grid .content-item i {
    font-size: 40px;
    margin-bottom: 10px;
    display: block;
}

/* Download button for files */
.file-download-btn {
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    margin-top: 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-download-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.file-download-btn:active {
    transform: translateY(0);
}

/* File locate button */
.file-locate-btn {
    background: #007cba;
    color: #fff;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    opacity: 0.8;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.file-locate-btn:hover {
    background: rgb(75, 134, 202);
    opacity: 1;
    transform: translateY(-1px);
}

.file-locate-btn i {
    font-size: 10px;
    margin: 0;
}

/* List Layout */
.lknwp-filebrowser-content.list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.lknwp-filebrowser-content.list .content-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #e1e5e9;
    cursor: pointer;
    transition: background 0.3s ease;
}

.lknwp-filebrowser-content.list .content-item:hover {
    background: #f8f9fa;
}

.lknwp-filebrowser-content.list .content-item:last-child {
    border-bottom: none;
}

.lknwp-filebrowser-content.list .content-item i {
    font-size: 24px;
    margin-right: 15px;
    width: 30px;
    text-align: center;
}

.lknwp-filebrowser-content.list .content-item-info {
    margin-left: auto;
    font-size: 12px;
    color: #6c757d;
}

/* Download button in list layout */
.lknwp-filebrowser-content.list .file-download-btn {
    margin-left: 10px;
    margin-top: 0;
    padding: 4px 8px;
    font-size: 10px;
}

/* File locate button in list layout */
.lknwp-filebrowser-content.list .file-locate-btn {
    position: static;
    margin-right: 10px;
    margin-top: 0;
    width: 22px;
    height: 22px;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* File type colors */
.content-item.folder i,
.content-item.search-result-folder i {
    color: #ffa500;
}

.content-item.file i {
    color: #6c757d;
}

.content-item.file.pdf i {
    color: #dc3545;
}

.content-item.file.doc i,
.content-item.file.docx i {
    color: #2196f3;
}

.content-item.file.xls i,
.content-item.file.xlsx i {
    color: #4caf50;
}

.content-item.file.ppt i,
.content-item.file.pptx i {
    color: #ff9800;
}

.content-item.file.jpg i,
.content-item.file.jpeg i,
.content-item.file.png i,
.content-item.file.gif i {
    color: #9c27b0;
}

.content-item.file.txt i {
    color: #795548;
}

.content-item-name {
    font-weight: 500;
    margin-bottom: 5px;
    word-break: break-word;
    color: #212529;
    font-size: 12px;
}

.lknwp-filebrowser-content.list .content-item-name {
    margin-bottom: 0;
    flex: 1;
}

.content-item-info {
    font-size: 11px;
    color: #6c757d;
}



/* File action buttons - DEPRECATED - keeping for potential future use */

/* Loading state */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    grid-column: 1 / -1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.loading i {
    font-size: 32px;
    margin-bottom: 15px;
    animation: spin 1s linear infinite;
    color: #007cba;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Empty state */
.empty-folder {
    text-align: center;
    padding: 80px 20px;
    color: #6c757d;
    grid-column: 1 / -1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.empty-folder i {
    font-size: 64px;
    margin-bottom: 20px;
    display: block;
    color: #dee2e6;
}

.empty-folder h3 {
    margin-bottom: 10px;
    color: #495057;
    font-size: 18px;
    font-weight: 500;
}

.empty-folder p {
    margin: 0;
    font-size: 14px;
}

/* Search results */
.search-results-header {
    display: flex;
    height: 100%;
    align-items: center;
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 4px;
    padding: 10px 15px;
    max-height: 70px;
    margin: 0px;
    font-size: 14px;
    color: #1565c0;
    grid-column: 1 / -1;
    box-sizing: border-box;
    /* Ocupa toda a largura da grid */
}

.search-results-header i {
    margin-right: 8px;
}

/* Search result items styling */
.search-results .content-item.search-result-folder {
    cursor: pointer;
}

.search-results .content-item.search-result-folder:hover {
    border-color: #007cba;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.15);
    transform: translateY(-2px);
}

.search-results .content-item.search-result-file:hover {
    border-color: #007cba;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.15);
    transform: translateY(-2px);
}

/* Search results layouts */
.search-results.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    grid-column: 1 / -1;
}

.search-results.list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.search-results.list .content-item {
    border-bottom: 1px solid #e1e5e9;
}

.search-results.list .content-item:last-child {
    border-bottom: none;
}

/* Icons */

.fa-caret-down,
.fa-caret-right {
    margin: 0px !important;
    font-size: 12px !important;
    color: #c2c2c2 !important;
}

.fa-folder {
    color: #ffa500;
}

.fa-home {
    color: #0073aa;
}

.fa-external-link-alt {
    color: #fff !important;
    margin: 0px !important;
    font-size: 14px !important;
}

/* Ícones ficam brancos quando o item está ativo/selecionado */
.folder-item-public.active .fa-folder,
.folder-item-public.active .fa-home {
    color: #fff !important;
}

/* Responsive Design - Organizado */
/* Desktop - Acima de 1200px: 5-6 itens por linha */
@media (min-width: 1200px) {

    .lknwp-filebrowser-content.grid,
    .search-results.grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
}

/* Tablet - 768px a 1199px: 3 itens por linha */
@media (min-width: 768px) and (max-width: 1199px) {

    .lknwp-filebrowser-content.grid,
    .search-results.grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .lknwp-file-manager-public {
        flex-direction: column;
    }

    .lknwp-sidebar-public {
        width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid #e1e5e9 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Mobile - Abaixo de 768px: 2 itens por linha */
@media (max-width: 767px) {

    .lknwp-filebrowser-content.grid,
    .search-results.grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .lknwp-filebrowser-content.grid .content-item {
        padding: 10px 8px;
    }

    .lknwp-filebrowser-content.grid .content-item i {
        font-size: 32px;
        margin-bottom: 8px;
    }

    .lknwp-search-container {
        padding: 15px;
    }

    .lknwp-search-box {
        max-width: none;
    }

    .lknwp-search-box input {
        font-size: 14px;
        padding: 10px 15px !important;
    }

    .lknwp-search-box button {
        padding: 10px 12px;
        font-size: 14px;
    }

    .lknwp-layout-controls {
        padding: 8px 15px;
    }

    .lknwp-filebrowser-content.list .content-item {
        padding: 10px;
    }

    .lknwp-filebrowser-content.list .content-item i {
        font-size: 20px;
        margin-right: 10px;
        width: 25px;
    }

    .content-item-name {
        font-size: 11px;
    }

    .content-item-info {
        font-size: 10px;
    }

    .file-download-btn {
        padding: 4px 8px;
        font-size: 9px;
        margin-top: 6px;
    }

    .lknwp-file-manager-public {
        flex-direction: column;
    }

    .lknwp-sidebar-public {
        width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid #e1e5e9 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Focus styles for accessibility */
.lknwp-search-box input:focus,
.layout-btn:focus,
.content-item:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Hover effects for touch devices */
@media (hover: none) {
    .lknwp-filebrowser-content.grid .content-item:hover {
        transform: none;
    }
}

/* Folder Tree Styles for Public Frontend */
.lknwp-sidebar-public {
    width: 100%;
    background: #f8f9fa;
    border-right: 1px solid #e1e5e9;
    padding: 20px;
    overflow-y: auto;
    box-sizing: border-box;
    max-width: 350px;
}

.lknwp-sidebar-public h4 {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #495057;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

#lknwp-folder-tree-public {
    font-size: 14px;
}

.folder-item-public {
    padding: 8px 0;
    cursor: pointer;
    color: #333;
    border-left: 3px solid transparent;
    padding-left: 10px;
    padding-right: 10px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 4px;
    margin-bottom: 2px;
}

.folder-item-public:hover {
    background: #e9ecef;
    border-left-color: #0073aa;
}

.folder-item-public.active {
    background: #0073aa;
    color: #fff;
    border-left-color: #005177;
}

.folder-item-public i {
    margin-right: 8px;
    width: 16px;
    font-size: 14px;
}

.folder-item-content-public {
    display: flex;
    align-items: center;
    flex: 1;
}

.folder-toggle-btn-public {
    background: none;
    border: none;
    color: #0073aa;
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    border-radius: 2px;
    transition: all 0.2s ease;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.folder-toggle-btn-public:hover {
    background: #e8f4f8;
    color: #0073aa;
}

.folder-item-public.child-folder-public {
    display: none;
}

.folder-item-public.child-folder-public.show {
    display: flex;
}

/* File items in tree */
.file-item-public {
    padding: 6px 0;
    color: #666;
    border-left: 3px solid transparent;
    padding-left: 10px;
    padding-right: 10px;
    margin-left: -10px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 4px;
    margin-bottom: 1px;
    font-size: 13px;
}

.file-item-public:hover {
    background: #f1f3f4;
    border-left-color: #28a745;
}

.file-item-content-public {
    display: flex;
    align-items: center;
    flex: 1;
}

.file-item-content-public i {
    margin-right: 8px;
    width: 16px;
    font-size: 12px;
}

.file-navigate-btn-public {
    background: none;
    border: none;
    color: #28a745;
    font-size: 12px;
    cursor: pointer;
    padding: 4px;
    border-radius: 2px;
    transition: all 0.2s ease;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.7;
}

.file-navigate-btn-public:hover {
    background: #e8f5e8;
    color: #28a745;
    opacity: 1;
}

.file-item-public.child-file-public {
    display: flex;
}

/* Highlighted file in main content */
.content-item.highlighted-file {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.2) !important;
    background: #f8fff8 !important;
    transform: scale(1.02) !important;
    z-index: 10;
    position: relative;
}

/* Setas do toggle das pastas no frontend */
.fa-caret-down,
.fa-caret-right {
    margin: 0px !important;
    font-size: 12px !important;
    color: #c2c2c2 !important;
}

/* File type colors - Updated to make folders yellow */
.content-item.folder i,
.content-item.search-result-folder i {
    color: #ffa500;
}

.lknwp-file-manager-public {
    display: flex;
    min-height: 400px;
}

.lknwp-content-public {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.lknwp-content-public.full-width {
    width: 100%;
}

/* Loading and Error States */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    color: #6c757d;
    min-height: 120px;
    box-sizing: border-box;
}

.loading i {
    font-size: 24px;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

.error {
    color: #dc3545;
    padding: 20px;
    text-align: center;
    font-style: italic;
    grid-column: 1 / -1;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Tree file items */
.file-item-tree {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-left: 3px solid transparent;
    font-size: 14px;
    color: #555;
}

.file-item-tree:hover {
    background-color: #f8f9fa;
    border-left-color: #007cba;
}

.file-item-content-tree {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 8px;
}

.file-item-content-tree i {
    font-size: 14px;
    color: #666;
    width: 16px;
    text-align: center;
}

.file-item-tree .file-locate-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: #007cba;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.file-item-tree:hover .file-locate-btn {
    opacity: 1;
}

.file-item-tree .file-locate-btn:hover {
    background: #005a87;
    transform: scale(1.1);
}

/* Child files in tree - hidden by default */
.file-item-tree.child-file-tree {
    display: none;
}

.file-item-tree.child-file-tree.show {
    display: flex;
}

/* File tree items clickable like folders */
.file-item-tree:hover {
    background-color: #f8f9fa;
    border-left-color: #28a745;
}

.file-item-tree .file-item-content-tree {
    cursor: pointer;
}

/* Selected file in tree */
.file-item-tree.selected {
    background-color: #d4edda !important;
    border-left-color: #28a745 !important;
    color: #155724;
}

.file-item-tree.selected i {
    color: #28a745 !important;
}

/* Selected file in main content (when clicked) - simple green background */
.lknwp-filebrowser-content .content-item.file.selected-in-tree {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2) !important;
    background-color: #f8fff8 !important;
}

/* Ensure folders are NOT affected by file selection styles */
.lknwp-filebrowser-content .content-item.folder {
    background-color: #fff !important;
}