/* Archivio Page Styles */
.folder-tree-item {
    padding-left: 1.5rem;
}

.folder-tree-item .nav-link {
    font-size: 0.9rem;
}

.folder-tree-item .nav-link i {
    font-size: 0.875rem;
}

/* Files Grid View */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
}

.file-card {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: white;
}

.file-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.file-card.selected {
    background-color: #e7f3ff;
    border-color: var(--primary-color);
}

.file-icon {
    font-size: 3.5rem;
    margin-bottom: 0.75rem;
}

.file-icon.folder {
    color: #ffc107;
}

.file-icon.pdf {
    color: #dc3545;
}

.file-icon.image {
    color: #28a745;
}

.file-icon.doc {
    color: #007bff;
}

.file-icon.xls {
    color: #28a745;
}

.file-icon.default {
    color: #6c757d;
}

.file-name {
    font-weight: 500;
    color: #212529;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    word-wrap: break-word;
}

.file-info {
    font-size: 0.75rem;
    color: #6c757d;
}

.file-actions {
    margin-top: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.file-card:hover .file-actions {
    opacity: 1;
}

.file-actions .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Files List View - Modern Table Style */
.table-responsive {
    background-color: white;
    border-radius: 8px;
    overflow: visible;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    color: #6c757d;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table thead th:nth-child(2) {
    text-align: right;
}

.table thead th:nth-child(3) {
    text-align: center;
}

.table thead th:nth-child(4) {
    text-align: right;
}

.table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table tbody tr:last-child {
    border-bottom: none;
}

.table tbody td {
    padding: 0 1rem;
    vertical-align: middle;
    font-size: 0.9rem;
    color: #212529;
    height: 56px;
}

.file-item {
    cursor: pointer;
}

.file-item.selected {
    background-color: #e7f3ff;
}

/* Files List View (old grid style - keeping for backwards compatibility) */
.files-list {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.files-list-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 100px;
    padding: 1rem 1.25rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 600;
    font-size: 0.875rem;
    color: #6c757d;
}

.file-item-name {
    display: flex;
    align-items: center;
}

.file-item-icon {
    font-size: 2rem;
    margin-right: 1rem;
}

.file-item-text {
    flex: 1;
    min-width: 0;
}

.file-item-title {
    font-weight: 500;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item-subtitle {
    font-size: 0.75rem;
    color: #6c757d;
}

.file-item-size,
.file-item-modified {
    font-size: 0.875rem;
    color: #6c757d;
}

.file-item-actions {
    text-align: right;
}

.file-item-actions .dropdown-toggle {
    background: none;
    border: none;
    color: #6c757d;
    padding: 0.375rem;
}

.file-item-actions .dropdown-toggle:hover {
    color: #212529;
}

/* Responsive */
@media (max-width: 992px) {
    .files-list-header,
    .file-item {
        grid-template-columns: 2fr 1fr 80px;
    }

    .file-item-size {
        display: none;
    }

    .files-list-header .file-item-size {
        display: none;
    }
}

@media (max-width: 768px) {
    .files-list-header {
        display: none;
    }

    .file-item {
        grid-template-columns: 1fr auto;
        gap: 0.5rem;
    }

    .file-item-size,
    .file-item-modified {
        display: none;
    }

    .files-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }
}

/* Empty State */
.archive-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.archive-empty-state i {
    font-size: 5rem;
    opacity: 0.2;
    margin-bottom: 1.5rem;
}

.archive-empty-state h4 {
    margin-bottom: 0.5rem;
    color: #495057;
}

.archive-empty-state p {
    margin-bottom: 1.5rem;
}

/* Drag & Drop */
#filesContainer.drag-over {
    background-color: #e7f3ff;
    border: 2px dashed #007bff;
    border-radius: 12px;
    opacity: 0.8;
}

#filesContainer.drag-over::after {
    content: '\f526';
    font-family: 'bootstrap-icons';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5rem;
    color: #007bff;
    opacity: 0.5;
    pointer-events: none;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar .nav-link {
    padding: 0.5rem 1rem;
    color: #495057;
    font-size: 0.9rem;
}

.sidebar .nav-link:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.sidebar .nav-link.active {
    background-color: #e7f3ff;
    color: #007bff;
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
}

.sidebar-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.archive-item {
    transition: all 0.2s;
}

.archive-item:hover {
    padding-left: 1.2rem;
}

.archive-settings-btn {
    opacity: 0;
    transition: opacity 0.2s;
    padding: 0.25rem 0.5rem;
}

.nav-item:hover .archive-settings-btn {
    opacity: 1;
}

.archive-settings-btn:hover {
    color: #007bff !important;
}

/* Main Content */
.main-content {
    padding: 1rem 2rem;
}

/* File icons styling */
.table tbody td i.bi {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: inline-block;
    text-align: center;
    line-height: 1;
    vertical-align: middle;
    padding-top: 8px;
}

/* File thumbnail styling */
.file-thumbnail {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    display: inline-block;
    vertical-align: middle;
}

/* File/Folder icon container with hover effect */
.file-icon-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
    margin-right: 0.5rem;
    width: 40px;
    height: 40px;
    vertical-align: middle;
}

.file-icon-container:hover .file-preview-overlay {
    opacity: 1;
}

/* Folder hover effect - change to open folder */
.file-icon-container.folder-icon:hover .bi-folder-fill::before {
    content: "\F3D8"; /* bi-folder-open-fill */
}

/* Prevent file preview overlay on folders */
.file-icon-container.folder-icon .file-preview-overlay {
    display: none;
}

.file-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.file-preview-overlay i {
    color: white;
    font-size: 1.25rem;
    width: auto;
    height: auto;
}

/* Truncate long filenames */
.file-name-text {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
    vertical-align: middle;
}

/* Breadcrumb styling */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item {
    font-size: 1.125rem;
    font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-size: 1.25rem;
}

/* Search input styling */
.input-group .input-group-text {
    border-right: 0;
}

.input-group .form-control {
    border-left: 0;
}

.input-group .form-control:focus {
    box-shadow: none;
    border-color: #ced4da;
}

/* Dropdown menu for file actions */
.dropdown-toggle::after {
    display: none;
}

.dropdown-menu {
    font-size: 0.875rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border: 1px solid #e0e0e0;
    z-index: 1050;
}

.dropdown-item {
    padding: 0.5rem 1rem;
}

.dropdown-item i {
    width: 18px;
    text-align: center;
}

/* Dropdown button styling */
.table tbody td .dropdown {
    display: inline-block;
    vertical-align: middle;
}

.table tbody td .dropdown .btn-link {
    padding: 8px;
}

/* Table hover effect improvement */
.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f5f5f5;
}

/* File/Folder name styling */
.table tbody td:first-child {
    font-weight: 500;
}

/* Dimensione column - align right */
.table tbody td:nth-child(2) {
    text-align: right;
}

/* Ultima modifica column - align center */
.table tbody td:nth-child(3) {
    text-align: center;
}

/* Button styling */
.btn-sm {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

/* Action buttons in table */
.table tbody td .btn-link {
    padding: 8px;
    text-decoration: none;
    display: inline-block;
    line-height: 1;
    width: 32px;
    height: 32px;
    text-align: center;
    vertical-align: middle;
}

.table tbody td .btn-link:hover {
    opacity: 0.7;
}

.table tbody td .btn-link i {
    font-size: 1.125rem;
    display: inline-block;
    line-height: 16px;
    vertical-align: middle;
    padding-top: 0;
}

/* Last column (actions) - align buttons horizontally */
.table tbody td:last-child {
    text-align: right;
    white-space: nowrap;
}
