/* Custom styles for Google Drive Browser */

/* Reset and base styles */
html, body {
    height: 100%;
    overflow: hidden;
}

/* Mobile sidebar toggle */
.mobile-sidebar-toggle {
    top: 10px;
    left: 10px;
    z-index: 1001;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display: none;
    padding: 0;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1/1; /* Ensure perfect circle */
}

/* Mobile navigation adjustments */
@media (max-width: 767px) {
    /* Adjust file navigation bar for mobile when toggle is visible */
    .mobile-sidebar-toggle + #fileNavBar,
    #fileNavBar {
        padding-left: 60px; /* Make space for toggle button */
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        padding-right: 0.5rem;
    }
    
    /* Mobile toggle positioning - move down when nav bar is visible */
    .mobile-sidebar-toggle {
        top: 15px;
        left: 15px;
        z-index: 1002; /* Higher than nav bar */
    }
    
    /* File navigation responsive layout */
    @media (max-width: 767px) {
        #fileNavBar .d-flex {
            flex-direction: column;
            align-items: flex-start;
            gap: 0.5rem;
        }
    }
    
    #fileNavBar .flex-grow-1 {
        width: 100%;
        margin-bottom: 0;
    }
    
    /* File name section with better mobile styling */
    @media (max-width: 767px) {
        #fileNavBar .d-flex.align-items-center {
            flex-direction: column;
            align-items: flex-start;
            width: 100%;
            gap: 0.125rem;
        }
        
        /* File icon and name row */
        #fileNavBar .d-flex.align-items-center > div {
            display: block;
            align-items: center;
            width: 100%;
            min-width: 0; /* Allow flex children to shrink */
        }
        
        /* Ensure the flex-grow-1 div can shrink properly */
        #fileNavBar .flex-grow-1.min-w-0 {
            min-width: 0;
            flex: 1;
            overflow: hidden;
        }
    }
    
    @media (max-width: 767px) {
        #fileName {
            font-size: 1rem;
            line-height: 1.25;
            font-weight: 600;
            color: #2c3e50;
            flex: 1;
            min-width: 0;
            word-wrap: break-word;
            overflow-wrap: break-word;
            white-space: normal;
            overflow: visible;
            text-overflow: initial;
            margin-bottom: 0.125rem;
        }
        
        #fileModified {
            font-size: 0.65rem;
            color: #6c757d;
            width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            opacity: 0.8;
            margin-top: -0.125rem;
        }
        
        #fileIcon {
            display: none; /* Hide file icon in mobile view */
        }
    }
    
    /* Open in Drive button mobile styles */

}

.mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
}

/* Mobile layout - completely override Bootstrap grid */
@media (max-width: 767px) {
    html, body {
        overflow: auto;
        height: auto;
    }
    
    /* Override Bootstrap container and row */
    .container-fluid {
        padding: 0 !important;
        height: auto !important;
    }
    
    .container-fluid .row {
        margin: 0 !important;
        height: auto !important;
        display: block !important;
    }
    
    .container-fluid .row > div {
        width: 100% !important;
        padding: 0 !important;
        flex: none !important;
    }
    
    /* Touch-friendly improvements */
    .file-item, .folder-header, .btn {
        min-height: 44px; /* Apple recommended touch target size */
    }
    
    /* Better touch targets */
    .folder-toggle {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Mobile sidebar behavior - override Bootstrap grid */
    .mobile-sidebar-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        padding: 0 !important;
        border: none !important;
        width: 44px !important;
        height: 44px !important;
        border-radius: 50% !important;
        aspect-ratio: 1/1;
    }
    
    /* Hide mobile toggle when no folder is selected */
    body.no-folder .mobile-sidebar-toggle {
        display: none !important;
    }
    
    /* Mobile layout is now properly handled above */
    
    /* Mobile sidebar - slide in from left */
    #sidebar {
        position: fixed !important;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh !important;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 2px 0 15px rgba(0,0,0,0.2);
        background: #fff !important;
        border: none !important;
        overflow-y: auto;
    }
    
    /* Ensure sidebar content is scrollable on mobile */
    #sidebar .d-flex.flex-column.h-100 {
        height: 100vh !important;
        overflow: hidden;
    }
    
    #sidebar #fileList {
        overflow-y: none;
        flex: 1;
    }
    
    #sidebar.mobile-open {
        left: 0;
    }
    
    /* Main content takes full width on mobile */
    #mainContent {
        width: 100% !important;
        flex: none !important;
        height: 100vh !important;
        position: relative;
    }
    
    /* When sidebar is open on mobile, show overlay */
    .mobile-sidebar-overlay.show {
        display: block;
    }
    
    /* Mobile content adjustments */
    #mainContentArea {
        padding: 0.5rem;
        height: calc(100vh - 80px); /* Account for nav bar */
        overflow-y: auto;
    }
    
    /* Mobile file navigation bar - base styles */
    #fileNavBar {
        position: relative;
        z-index: 10;
        background: #fff;
        border-bottom: 1px solid #dee2e6;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    /* Adjust main content when nav bar is visible */
    #fileNavBar:not(.file-nav-bar-hidden) + #mainContentArea {
        height: calc(100vh - 120px);
    }
    
    /* Mobile search and sidebar content */
    .search-filter-container {
        padding: 0.75rem;
    }
    
    .search-section {
        padding: 0.5rem;
    }
    
    .search-section .form-control {
        font-size: 0.875rem;
        padding: 0.5rem;
    }
    
    .form-check-label {
        font-size: 0.8rem;
    }
    
    .search-help-text {
        font-size: 0.65rem;
    }
    
    /* Mobile sidebar header */
    #sidebar .p-3 {
        padding: 1rem !important;
    }
    
    .sidebar-title .title-text {
        font-size: 1rem;
    }
    
    /* Mobile file items */
    .file-item {
        margin-bottom: 1px;
        padding: 0.75rem 0.5rem;
        min-height: 50px;
    }
    
    .file-item .file-name {
        font-size: 0.9rem;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
        overflow: visible;
        text-overflow: initial;
    }
    
    .file-item .file-icon {
        width: 16px;
        height: 16px;
    }
    
    .file-item .file-icon i {
        font-size: 0.8rem;
    }
    
    /* Mobile nested items */
    .nested-file-item, .nested-folder-item {
        padding: 0.6rem 0.5rem;
        min-height: 45px;
    }
    
    .nested-file-item .file-name, .nested-folder-item .file-name {
        font-size: 0.75rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
        overflow: visible;
        text-overflow: initial;
        line-height: 1.2;
    }
    
    /* Mobile folder controls */
    .folder-header {
        padding: 0.75rem 0.5rem;
        min-height: 50px;
    }
    
    .folder-toggle {
        padding: 0.25rem;
        min-width: 36px;
        min-height: 36px;
    }
    
    /* Mobile buttons */
    .btn-sm {
        font-size: 0.8rem;
        padding: 0.375rem 0.75rem;
        min-height: 36px;
        min-width: 36px;
    }
}

/* CSS classes to replace inline styles */
.sidebar-hidden {
    display: none;
}

.favicon-icon {
    width: 50px;
    height: 50px;
}

.sidebar-title {
    display: flex;
    align-items: center;
    font-weight: 700;
    color: #2c3e50;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.sidebar-title .favicon-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.sidebar-title:hover .favicon-icon {
    transform: scale(1.1);
}

.sidebar-title .title-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    position: relative;
}

.sidebar-title .title-text::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    border-radius: 1px;
}

.sidebar-title:hover .title-text::after {
    width: 100%;
}

/* Enhanced sidebar header */
#sidebar .p-3.border-bottom {
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.8) 0%, rgba(255, 255, 255, 0.9) 100%);
    border-bottom: 2px solid rgba(102, 126, 234, 0.15);
    backdrop-filter: blur(10px);
}

.file-nav-bar-hidden {
    display: none;
}

.file-nav-icon {
    font-size: 1.3rem;
}

.search-help-text {
    font-size: 0.7rem;
}

#sidebar {
    height: 100vh;
    position: sticky;
    top: 0;
}

#mainContent {
    height: 100vh;
    overflow: hidden;
}

/* Desktop layout - ensure proper column behavior */
@media (min-width: 768px) {
    .container-fluid .row {
        display: flex;
        flex-wrap: nowrap;
        height: 100vh;
    }
    
    #sidebar {
        position: relative;
        height: 100vh;
        flex: 0 0 auto;
    }
    
    #mainContent {
        flex: 1;
        height: 100vh;
        min-width: 0; /* Prevent flex item from overflowing */
    }
    
    /* Ensure mobile toggle is hidden on desktop */
    .mobile-sidebar-toggle {
        display: none !important;
    }
    
    /* Reset mobile overrides for desktop */
    .container-fluid {
        padding: 0;
        height: 100vh;
    }
}

/* Sidebar styling */
#sidebar .list-group-item {
    border-left: none;
    border-right: none;
    border-radius: 0;
    padding: 0.75rem 1rem;
}

#sidebar .list-group-item:first-child {
    border-top: none;
}

#sidebar .list-group-item.active {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

#sidebar .list-group-item:hover {
    background-color: var(--bs-light);
}

#sidebar .list-group-item.active:hover {
    background-color: var(--bs-primary);
}

/* File list styling */
.file-item {
    transition: all 0.2s ease;
    border-color: rgba(0, 0, 0, 0.1);
    padding: 0.375rem 0.5rem;
}

.file-item:hover {
    background-color: rgba(102, 126, 234, 0.05);
    transform: translateX(2px);
}

.file-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-color: rgba(102, 126, 234, 0.4);
    color: #2c3e50;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.25);
    transform: translateX(5px);
}

.file-item.active:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    color: #2c3e50;
}

.file-item.active * {
    color: #2c3e50;
}

.file-item.active .text-muted {
    color: #6c757d;
}

.file-item .file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.file-item .file-icon i {
    font-size: 0.875rem;
}

.file-item .file-name {
    line-height: 1.2;
    font-size: 0.9rem;
    font-weight: 500;
}

.file-item .file-meta {
    line-height: 1.2;
}



/* Folder-specific styling */
.folder-item {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.05) 0%, rgba(255, 193, 7, 0.1) 100%);
    border-left: 3px solid #ffc107;
}

.folder-item:hover {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 193, 7, 0.2) 100%);
    border-left-color: #ff8c00;
    cursor: pointer;
}



/* Navigation state */
.file-item.navigating {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-left-color: #667eea;
    animation: pulse 1.5s ease-in-out infinite;
}

.file-item.navigating .file-icon i {
    animation: spin 1s linear infinite;
}



/* Loading state enhancements */
.spinner-border.text-primary {
    --bs-spinner-border-width: 3px;
    animation: spin 0.75s linear infinite, pulse 2s ease-in-out infinite;
}

/* Empty folder state */
.empty-folder-icon {
    animation: fadeIn 0.5s ease-in-out;
}

.empty-folder-icon i {
    transition: all 0.3s ease;
    font-size: 3rem;
    opacity: 0.5;
}

.empty-folder-icon:hover i {
    transform: scale(1.05);
    opacity: 0.7;
}



/* Enhanced file list container */
#fileList {
    min-height: 200px;
    transition: all 0.3s ease;
}

#fileList:empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* File selection badge styling */
.badge.bg-primary {
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
}

/* Current folder indicator in file header */
.file-meta .bi-folder {
    color: #667eea;
}





@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}



/* Search input styling */
#searchInput:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}



/* Button styling */
.btn-sm {
    font-size: 0.875rem;
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Icon styling */
.bi {
    font-size: 1rem;
}

.fs-1 .bi {
    font-size: 3rem;
}

.fs-4 .bi {
    font-size: 1.5rem;
}

/* Alert styling */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Badge styling */
.badge {
    font-size: 0.75rem;
}

/* File navigation bar */
.file-nav-bar {
    transition: all 0.3s ease;
}

.file-nav-bar.show {
    display: block;
}

/* Enhanced Mobile Responsive Design */

/* Tablet screens (768px - 991px) */
@media (max-width: 991px) and (min-width: 768px) {
    .container-fluid .row {
        flex-direction: column;
    }
    
    #sidebar:not(.sidebar-hidden) {
        height: auto;
        position: relative;
        order: 1;
        max-height: 40vh;
        overflow-y: auto;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
        width: 100% !important;
        flex: none !important;
    }
    
    #mainContent {
        height: auto;
        min-height: 60vh;
        order: 2;
        width: 100% !important;
        flex: none !important;
    }
    
    /* Better file navigation bar on tablets */
    #fileNavBar {
        padding: 0.75rem;
    }
    
    #fileNavBar h6 {
        font-size: 0.95rem;
    }
}
    
/* Small mobile screens - extra optimizations */
@media (max-width: 576px) {
    /* Even more compact on very small screens */
    .mobile-sidebar-toggle {
        width: 40px !important;
        height: 40px !important;
        top: 8px;
        left: 8px;
        border-radius: 50% !important;
        padding: 0 !important;
        border: none !important;
        aspect-ratio: 1/1;*/
    }
    
    #sidebar {
        width: 90%;
        max-width: 300px;
    }
    
    /* Compact sidebar content */
    #sidebar .p-3 {
        padding: 0.5rem;
    }
    
    .sidebar-title .title-text {
        font-size: 0.85rem;
    }
    
    .search-filter-container {
        padding: 0.375rem;
    }
    
    .search-section {
        padding: 0.25rem;
    }
    
    /* Even more compact file items */
    .file-item {
        padding: 0.375rem 0.25rem;
        min-height: 40px;
    }
    
    .file-item .file-name {
        font-size: 0.8rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
        overflow: visible;
        text-overflow: initial;
        line-height: 1.2;
    }
    
    .nested-file-item, .nested-folder-item {
        padding: 0.375rem 0.25rem;
        min-height: 36px;
    }
    
    .folder-header {
        padding: 0.375rem 0.25rem;
        min-height: 40px;
    }
    
    /* Optimize folder names specifically */
    .folder-header .file-name {
        font-size: 0.8rem;
        line-height: 1.2;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
    }
    
    /* Compact navigation bar and button for smaller screens */
    @media (max-width: 576px) {
        #fileNavBar {
            padding-left: 55px;
            padding-top: 0.5rem;
            padding-bottom: 0.5rem;
            padding-right: 0.375rem;
        }
        
        #fileName {
            margin-left: 36px;
            font-size: 0.9rem;
            flex: 1;
            min-width: 0;
            word-wrap: break-word;
            overflow-wrap: break-word;
            white-space: normal;
            overflow: visible;
            text-overflow: initial;
            line-height: 1.2;
            margin-bottom: 0.125rem;
        }
        
        #fileModified {
            font-size: 0.6rem;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            width: 100%;
            opacity: 0.75;
            margin-top: -0.125rem;
        }
        
        /* Even more compact Open in Drive button */
        #openInDriveBtn {
            padding: 0.375rem 0.75rem;
            font-size: 0.8rem;
        }
    }
    
    /* Smaller toggle button for very small screens */
    .mobile-sidebar-toggle {
        width: 38px !important;
        height: 38px !important;
        top: 8px !important;
        left: 8px !important;
        border-radius: 50% !important;
        padding: 0 !important;
        border: none !important;
        aspect-ratio: 1/1;
    }
    
    /* Main content adjustments */
    #mainContentArea .text-center {
        padding: 0.75rem;
    }
    
    #mainContentArea .display-5 {
        font-size: 1.25rem;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    #contentArea {
        background-color: #212529;
    }
    
    .bg-light {
        background-color: #343a40;
    }
    
    .text-muted {
        color: #adb5bd;
    }
    
    .border-end {
        border-color: #495057;
    }
    
    .border-bottom {
        border-color: #495057;
    }
}

/* Custom utility classes */
.min-w-0 {
    min-width: 0;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Animation for smooth transitions */
.file-item, .btn, .alert {
    transition: all 0.2s ease-in-out;
}

/* Focus styles for accessibility */
.file-item:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Loading overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}



/* File header styling */
.file-header {
    min-height: auto;
    border-bottom: none;
}

.file-header h5 {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 0;
}

.file-header .file-meta {
    color: #6c757d;
}

.file-header .file-meta i {
    width: 16px;
    text-align: center;
}

/* File icon large */
.file-icon-large {
    margin-bottom: 1rem;
}

.file-icon-large i {
    font-size: 5rem;
    opacity: 0.3;
}

/* Homepage improvements */
.display-5 {
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Search input improvements */
.input-group-lg .input-group-text {
    padding: 0.75rem 1rem;
    border-color: #ced4da;
}

.input-group-lg .form-control {
    border-color: #ced4da;
}

.input-group-lg .form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Sidebar folder search */
#sidebar .input-group-text {
    background-color: #f8f9fa;
    border-color: #e9ecef;
}

#sidebar .form-control {
    border-color: #e9ecef;
}

    #sidebar .form-control:focus {
        border-color: var(--bs-primary);
        box-shadow: 0 0 0 0.1rem rgba(13, 110, 253, 0.15);
    }
    
    /* Sidebar title responsive */
    .sidebar-title .title-text {
        font-size: 1rem;
    }
    
    .sidebar-title .favicon-icon {
        width: 24px;
        height: 24px;
    }

/* Button improvements */
.btn {
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
  /*  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4); */
}

.btn-outline-primary {
    border-color: #667eea;
    color: #667eea;
}

.btn-outline-primary:hover {
    background-color: #667eea;
    border-color: #667eea;
}

/* Enhanced animations and effects */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* File item enhanced styling */
.file-item {
    border-radius: 8px;
    margin-bottom: 2px;
    overflow: hidden;
    position: relative;
}

.file-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.file-item:hover::before {
    transform: scaleY(1);
}

.file-item.active::before {
    transform: scaleY(1);
    background: white;
}

/* Sidebar enhancements */
#sidebar {
    backdrop-filter: blur(10px);
    background: rgba(248, 249, 250, 0.95);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}



/* Enhanced file header styling for main content */
.file-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}



/* Enhanced loading animations */
.spinner-border {
    animation: spin 1s linear infinite, pulse 2s ease-in-out infinite;
}

/* Search input enhancements */
.input-group .form-control {
    border-radius: 0.25rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

.input-group .input-group-text {
    border-radius: 50px 0 0 50px;
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    border-color: #667eea;
    color: black;
}

.input-group .btn {
    border-radius: 0 50px 50px 0;
}



/* Search and filter container styling */
.search-filter-container {
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.9) 0%, rgba(255, 255, 255, 0.9) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(102, 126, 234, 0.1);
}

.search-filter-container .form-label {
    color: #495057;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
}

/* File tree structure */
.file-tree {
    background: white;
}

.current-folder-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

.tree-content {
    padding-left: 11px;
    max-height: calc(100vh - 210px);
    overflow-y: auto;
    overflow-x: hidden;

}

/* Folder tree items */
.folder-tree-item {
    border-bottom: 1px solid #f1f3f4;
    transition: all 0.3s ease;
}

.folder-tree-item:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

.folder-header {
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid #e9ecef;
}

.folder-header:hover {
    background-color: rgba(255, 193, 7, 0.1);
}

.folder-toggle {
    color: #6c757d;
    text-decoration: none;
    transition: all 0.3s ease;
}

.folder-toggle:hover {
    color: #495057;
    transform: scale(1.1);
}

.folder-toggle i {
    transition: transform 0.3s ease;
}

.folder-enter-btn {
    opacity: 0;
    transition: all 0.3s ease;
}

.folder-header:hover .folder-enter-btn {
    opacity: 1;
}

/* File tree items */
.file-tree-item.file-item {
    border-bottom: 1px solid #e1e6eb;
    transition: all 0.3s ease;
}

.file-tree-item.file-item:hover {
    background-color: rgba(13, 110, 253, 0.05);
    transform: translateX(2px);
}

.file-tree-item.file-item.active {
    background-color: rgba(13, 110, 253, 0.1);
    border-left: 4px solid #0d6efd;
}

.file-header {
    cursor: pointer;
    transition: all 0.3s ease;
}

.preview-icon {
    opacity: 0;
    transition: all 0.3s ease;
}

.file-header:hover .preview-icon {
    opacity: 1;
}

/* Nested items styling */
.nested-folder-item, .nested-file-item {
    border-bottom: 1px solid #e1e6eb;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nested-folder-item:hover, .nested-file-item:hover {
    background-color: rgba(102, 126, 234, 0.05);
    transform: translateX(2px);
}

.nested-file-item.active {
    background-color: rgba(13, 110, 253, 0.1);
    border-left: 3px solid #0d6efd;
}

.nested-file-header {
    cursor: pointer;
}

/* Nested folder tree styling */
.nested-folder-tree-item {
    border-bottom: 1px solid #f1f3f4;
}

.nested-folder-tree-item .nested-folder-item {
    border-bottom: none;
}

.nested-folder-toggle {
    color: #6c757d;
    text-decoration: none;
    transition: all 0.3s ease;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nested-folder-toggle:hover {
    color: #495057;
    transform: scale(1.1);
}

.nested-folder-toggle i {
    transition: transform 0.3s ease;
}

/* Nested folder contents */
.nested-folder-contents {
    background-color: rgba(248, 249, 250, 0.5);
    border-left: 2px solid rgba(102, 126, 234, 0.15);
    margin-left: 10px;
}

.nested-folder-content {
    background: transparent;
}

.nested-folder-loading {
    font-size: 0.8rem;
}

/* Progressive indentation for deeper nesting */
.nested-folder-tree-item {
    position: relative;
}

.nested-folder-tree-item.ms-3 {
    margin-left: 1rem;
}

.nested-folder-tree-item.ms-6 {
    margin-left: 2rem;
}

.nested-folder-tree-item.ms-9 {
    margin-left: 3rem;
}

.nested-folder-tree-item.ms-12 {
    margin-left: 4rem;
}

.nested-folder-tree-item.ms-15 {
    margin-left: 5rem;
}

/* Mobile optimizations for nested folders */
@media (max-width: 767px) {
    .tree-content {
        padding-left: 0px;
    }
    .nested-folder-tree-item.ms-3 {
        margin-left: 0.5rem;
    }

    .nested-folder-tree-item.ms-6 {
        margin-left: 1rem;
    }

    .nested-folder-tree-item.ms-9 {
        margin-left: 1.5rem;
    }

    .nested-folder-tree-item.ms-12 {
        margin-left: 2rem;
    }

    .nested-folder-tree-item.ms-15 {
        margin-left: 2.5rem;
    }
    
    .nested-folder-toggle {
        width: 16px;
        height: 16px;
        font-size: 0.7rem;
    }
    
    .nested-folder-contents {
        margin-left: 5px;
    }
}

/* Folder contents */
.folder-contents {
    background-color: #fafbfc;
    border-left: 3px solid rgba(102, 126, 234, 0.2);
}

.folder-content {
    background: white;
}

/* Filter improvements */
.filter-status {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 12px;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}



/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* Enhanced hover effects for file items */
.file-item .file-icon i {
    transition: all 0.3s ease;
}

.file-item:hover .file-icon i {
    transform: scale(1.2);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Modal-like effect for file preview */
.file-header + div iframe {
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin: 1rem;
    height: calc(100% - 2rem);
}

/* Homepage title enhanced styling */
.display-5 {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.display-5::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* Enhanced alert styling */
.alert {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-info {
    background: rgba(13, 202, 240, 0.1);
    color: #055160;
    border-left: 4px solid #0dcaf0;
}

/* Main content area styling for file preview */
#mainContentArea {
    background: #f8f9fa;
    position: relative;
}

#mainContentArea iframe {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#mainContentArea .text-center {
    color: #6c757d;
    padding: 2rem;
}

#mainContentArea .text-center i {
    opacity: 0.5;
    color: #6c757d;
}

/* Large folder loading states */
.large-folder-loading {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border: 1px solid rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    padding: 2rem;
    margin: 1rem;
}

.large-folder-loading .spinner-border {
    width: 2rem;
    height: 2rem;
    border-width: 0.25em;
    --bs-spinner-animation-speed: 0.8s;
}

.large-folder-loading .spinner-border.text-primary {
    --bs-spinner-border-width: 3px;
    animation: spin 0.75s linear infinite, pulse 2s ease-in-out infinite;
}

/* Enhanced alert messages for large folders */
.alert-success {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.1) 0%, rgba(25, 135, 84, 0.05) 100%);
    border: 1px solid rgba(25, 135, 84, 0.2);
    color: #155724;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: #856404;
}

.alert-info {
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.1) 0%, rgba(13, 202, 240, 0.05) 100%);
    border: 1px solid rgba(13, 202, 240, 0.2);
    color: #055160;
}





/* Enhanced loading messages */
.loading-message {
    text-align: center;
    padding: 2rem;
}

.loading-message.large-folder {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%);
    border-radius: 12px;
    margin: 1rem;
    border: 1px dashed rgba(102, 126, 234, 0.2);
}

.loading-message h6 {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.loading-message p {
    color: #6c757d;
    margin-bottom: 0;
}





/* Responsive alert improvements */
@media (max-width: 768px) {
    .alert {
        margin: 0.5rem;
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    .large-folder-loading {
        padding: 1.5rem;
        margin: 0.5rem;
    }
    
    .loading-message.large-folder {
        margin: 0.5rem;
        padding: 1.5rem;
    }
    

}

/* Search section styling */
.search-section {
    background: rgba(0, 123, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
}

/* FullText search toggle styling */

/* commenting out non bootsrap colors 

    .form-check-input:checked {
       background-color: #457b9d;
        border-color: #E5E5E5;
    }
    
    .form-check-input:focus {
        border-color: #E5E5E5;
        outline: 0;
        box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
    }
    
    .form-check-label {
        transition: color 0.2s ease;
    }
    
    .form-check-input:checked + .form-check-label {
        color: #457b9d;
    }

*/

#searchModeText {
    transition: all 0.3s ease;
}

.search-section .form-control {
    border: 1px solid rgba(0, 123, 255, 0.2);
    transition: all 0.3s ease;
}

.search-section .form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}





