/* Custom Variables */
:root {
    --sidebar-width: 250px;
    --header-height: 60px;
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
}

/* General Layout */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    padding: 1.5rem 0;
}

/* Required Field Indicator */
.form-label.required:after {
    content: '*';
    color: red;
    margin-left: 4px;
}

/* Card Hover Effects */
.card-hover {
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15);
}

/* Custom Table Styles */
.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Search Highlight */
.search-highlight {
    background-color: rgba(255, 193, 7, 0.3);
    padding: 0 2px;
    border-radius: 2px;
}

/* Loading Spinner Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .table-responsive {
        margin: 0 -0.75rem;
    }
    
    .btn-group-responsive {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer {
        flex-direction: column-reverse;
        gap: 0.5rem;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .table {
        border: 1px solid #dee2e6;
    }
    
    .table td, .table th {
        background-color: #fff !important;
    }
}



.folder-search-container {
    position: relative;
    min-width: 250px;
    max-width: 400px;
    width: 100%;
}

.folder-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid rgba(0,0,0,.125);
    border-radius: 0.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.folder-search-results .results-container {
    padding: 0.5rem;
}

.folder-search-results .folder-item {
    padding: 0.5rem;
    border-bottom: 1px solid rgba(0,0,0,.125);
    cursor: pointer;
    transition: background-color 0.2s;
}

.folder-search-results .folder-item:last-child {
    border-bottom: none;
}

.folder-search-results .folder-item:hover {
    background-color: rgba(0,0,0,.05);
}

.folder-search-results .no-results {
    padding: 1rem;
    text-align: center;
    color: #6c757d;
}

/* Search Styles */
.search-box {
    position: relative;
    width: 300px;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    margin-top: 5px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-height: 400px;
    overflow-y: auto;
}

.search-results .list-group-item {
    border-left: none;
    border-right: none;
    cursor: pointer;
}

.search-results .list-group-item:first-child {
    border-top: none;
}

.search-results .list-group-item:last-child {
    border-bottom: none;
}

.search-results .list-group-item:hover {
    background-color: #f8f9fa;
}

/* Dark Mode Variables */
[data-bs-theme="dark"] {
    --bs-body-bg: #212529;
    --bs-body-color: #dee2e6;
    --bs-border-color: #495057;
    --card-bg: #343a40;
    --input-bg: #2b3035;
    --input-color: #dee2e6;
    --input-border: #495057;
}

/* Dark Mode Overrides */
[data-bs-theme="dark"] .card {
    background-color: var(--card-bg);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: var(--input-bg);
    border-color: var(--input-border);
    color: var(--input-color);
}

[data-bs-theme="dark"] .table {
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .modal-content {
    background-color: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .search-results {
    background-color: var(--card-bg);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .list-group-item {
    background-color: var(--card-bg);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .list-group-item:hover {
    background-color: var(--input-bg);
}

/* Theme Toggle Button */
.theme-switch .light-icon,
.theme-switch .dark-icon {
    pointer-events: none;
}
