/* ===================================
   VISTAPHANTOR - COMPONENTS CSS
   Reusable Component Styles
   =================================== */

/* Property Cards */
.property-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    height: 100%;
}

.property-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.property-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.property-card:hover .property-image {
    transform: scale(1.05);
}

.property-content {
    padding: var(--spacing-lg);
}

.property-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--spacing-sm);
    line-height: 1.3;
}

.property-location {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
}

.property-location i {
    margin-right: var(--spacing-xs);
    color: var(--primary-color);
}

.property-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.property-features {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    font-size: 0.875rem;
    color: var(--gray-600);
}

.property-feature {
    display: flex;
    align-items: center;
}

.property-feature i {
    margin-right: var(--spacing-xs);
    color: var(--secondary-color);
}

.property-actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* Search Components */
.search-filters {
    background: var(--white);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-xl);
}

.filter-group {
    margin-bottom: var(--spacing-lg);
}

.filter-label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--spacing-sm);
}

.filter-control {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.filter-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

/* Live Search Dropdown */
.live-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.live-search-item {
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.live-search-item:hover {
    background-color: var(--gray-100);
}

.live-search-item:not(:last-child) {
    border-bottom: 1px solid var(--gray-100);
}

/* Property Gallery */
.property-gallery {
    margin-bottom: var(--spacing-xl);
}

.main-image-container {
    position: relative;
    margin-bottom: var(--spacing-md);
}

.main-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: var(--radius-lg);
}

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: var(--spacing-sm);
}

.gallery-image {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
}

.gallery-image:hover {
    transform: scale(1.05);
}

.gallery-image.active {
    border-color: var(--primary-color);
}

/* Notification System */
.notification {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 2000;
    max-width: 400px;
    animation: slideInRight 0.3s ease-out;
}

.notification-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.notification-close:hover {
    opacity: 1;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading States */
.loading-container {
    position: relative;
    min-height: 100px;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--gray-300);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xl);
}

.page-link {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    color: var(--gray-700);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.page-link:hover {
    background-color: var(--gray-100);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-link.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.page-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Breadcrumbs */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    font-size: 0.875rem;
    color: var(--gray-600);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin-left: var(--spacing-sm);
    color: var(--gray-400);
}

.breadcrumb-link {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-link:hover {
    text-decoration: underline;
}

.breadcrumb-current {
    color: var(--gray-900);
    font-weight: 600;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-available {
    background-color: #dcfce7;
    color: #166534;
}

.status-rented {
    background-color: #fef3c7;
    color: #92400e;
}

.status-sold {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-pending {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-maintenance {
    background-color: #f3e8ff;
    color: #7c3aed;
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    .property-actions {
        flex-direction: column;
    }
    
    .thumbnail-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .main-image {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .property-features {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .thumbnail-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
/* ===== COMPONENTS CSS - VISTAPHANTOR REAL ESTATE ===== */

/* ===== BUTTON COMPONENTS ===== */
.btn-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ===== CARD COMPONENTS ===== */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

/* ===== FORM COMPONENTS ===== */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.form-group-inline {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* ===== TABLE COMPONENTS ===== */
.table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-primary);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

.table tbody tr:hover {
    background-color: var(--bg-secondary);
}

/* ===== MODAL COMPONENTS ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--bg-primary);
    border-radius: 0.5rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* ===== ALERT COMPONENTS ===== */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background-color: #ecfdf5;
    border-color: #10b981;
    color: #065f46;
}

.alert-warning {
    background-color: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

.alert-error {
    background-color: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

.alert-info {
    background-color: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

/* ===== BADGE COMPONENTS ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary {
    background-color: var(--primary-color);
    color: white;
}

.badge-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.badge-success {
    background-color: #10b981;
    color: white;
}

.badge-warning {
    background-color: #f59e0b;
    color: white;
}

.badge-error {
    background-color: #ef4444;
    color: white;
}

/* ===== LOADING COMPONENTS ===== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

.loading-dots {
    display: inline-flex;
    gap: 0.25rem;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary-color);
    animation: bounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* ===== TOOLTIP COMPONENTS ===== */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 120px;
    background-color: var(--text-primary);
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ===== RESPONSIVE COMPONENTS ===== */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
}

/* ===== SIDEBAR COMPONENTS - VISTAPHANTOR REAL ESTATE ===== */

/* ===== SIDEBAR BASE STYLES ===== */
/* Sidebar navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
}

.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Custom scrollbar styling for webkit browsers */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
    transition: background 0.2s ease;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.8);
}

/* Dark mode scrollbar */
.dark .sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.3);
}

.dark .sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.6);
}

/* Ensure sidebar content can scroll */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    border-right: 1px solid #e5e7eb;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden; /* Hide main sidebar overflow */
    display: flex;
    flex-direction: column;
}

/* Sidebar content wrapper */
.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Sidebar header - fixed at top */
.sidebar-header {
    flex-shrink: 0;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(90deg, #eff6ff 0%, #e0e7ff 100%);
}

/* Sidebar navigation - scrollable */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0.75rem;
    min-height: 0; /* Allow flex item to shrink */
}

/* Sidebar footer - fixed at bottom */
.sidebar-footer {
    flex-shrink: 0;
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
    background: rgba(249, 250, 251, 0.8);
    backdrop-filter: blur(8px);
}

/* ===== SIDEBAR STATES ===== */

/* Expanded state (default) */
#sidebar.sidebar-expanded {
    width: 16rem; /* 256px */
    transform: translateX(0);
}

/* Icon-only state */
#sidebar.sidebar-icon-only {
    width: 3rem; /* 48px */
    transform: translateX(0);
}

/* Hidden state */
#sidebar.sidebar-hidden {
    width: 0;
    transform: translateX(-100%);
}

/* ===== SIDEBAR HEADER ===== */
.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(90deg, #eff6ff 0%, #e0e7ff 100%);
    position: relative;
}

.dark .sidebar-header {
    border-bottom-color: #374151;
    background: linear-gradient(90deg, #1f2937 0%, #1e1b4b 100%);
}

/* Logo container */
.sidebar-logo {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.sidebar-logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.sidebar-logo-icon i {
    color: white;
    font-size: 1.125rem;
}

.sidebar-logo-text {
    transition: all 0.3s ease;
}

.sidebar-logo-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    background: linear-gradient(90deg, #2563eb 0%, #4f46e5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.dark .sidebar-logo-title {
    color: white;
}

.sidebar-logo-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    white-space: nowrap;
}

.dark .sidebar-logo-subtitle {
    color: #9ca3af;
}

/* Control buttons */
.sidebar-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.sidebar-control-btn {
    background: rgba(255, 255, 255, 0.8);
    color: #6b7280;
    border: none;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-control-btn:hover {
    background: white;
    color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.dark .sidebar-control-btn {
    background: rgba(55, 65, 81, 0.8);
    color: #9ca3af;
}

.dark .sidebar-control-btn:hover {
    background: #374151;
    color: #60a5fa;
}

/* ===== SIDEBAR NAVIGATION ===== */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
}

.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Navigation items */
.sidebar-nav-item {
    margin: 0;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: 0.75rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.sidebar-nav-link:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
    transform: translateX(4px);
}

.dark .sidebar-nav-link {
    color: #d1d5db;
}

.dark .sidebar-nav-link:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

/* Active state */
.sidebar-nav-link.active {
    background: rgba(59, 130, 246, 0.15);
    color: #1d4ed8;
    font-weight: 600;
}

.dark .sidebar-nav-link.active {
    background: rgba(59, 130, 246, 0.25);
    color: #60a5fa;
}

/* Navigation icon */
.sidebar-nav-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sidebar-nav-link:hover .sidebar-nav-icon {
    transform: scale(1.1);
}

/* Icon colors for different sections */
.sidebar-nav-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.sidebar-nav-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.sidebar-nav-icon.purple {
    background: rgba(147, 51, 234, 0.1);
    color: #7c3aed;
}

.sidebar-nav-icon.orange {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.sidebar-nav-icon.red {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.sidebar-nav-icon.gray {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* Navigation text */
.sidebar-nav-text {
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
}

/* ===== DROPDOWN MENUS ===== */
.sidebar-dropdown {
    margin-top: 1.5rem;
}

.sidebar-dropdown-header {
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.sidebar-dropdown-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.dark .sidebar-dropdown-title {
    color: #9ca3af;
}

.sidebar-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #374151;
}

.sidebar-dropdown-trigger:hover {
    background: rgba(147, 51, 234, 0.1);
    color: #7c3aed;
}

.dark .sidebar-dropdown-trigger {
    color: #d1d5db;
}

.dark .sidebar-dropdown-trigger:hover {
    background: rgba(147, 51, 234, 0.2);
    color: #a78bfa;
}

.sidebar-dropdown-chevron {
    transition: transform 0.2s ease;
}

.sidebar-dropdown.open .sidebar-dropdown-chevron {
    transform: rotate(180deg);
}

.sidebar-dropdown-content {
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar-dropdown-item {
    padding: 0.5rem 0.75rem 0.5rem 3.5rem;
    color: #6b7280;
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
    border-radius: 0.5rem;
    margin: 0.25rem 0;
}

.sidebar-dropdown-item:hover {
    background: rgba(147, 51, 234, 0.05);
    color: #7c3aed;
    transform: translateX(4px);
}

.dark .sidebar-dropdown-item {
    color: #9ca3af;
}

.dark .sidebar-dropdown-item:hover {
    background: rgba(147, 51, 234, 0.1);
    color: #a78bfa;
}

/* ===== SIDEBAR FOOTER ===== */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
    margin-top: auto;
}

.dark .sidebar-footer {
    border-top-color: #374151;
}

.sidebar-footer-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    color: #6b7280;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-footer-btn:hover {
    background: rgba(107, 114, 128, 0.1);
    color: #374151;
}

.dark .sidebar-footer-btn {
    color: #9ca3af;
}

.dark .sidebar-footer-btn:hover {
    background: rgba(156, 163, 175, 0.1);
    color: #d1d5db;
}

.sidebar-footer-btn i {
    margin-right: 0.75rem;
    font-size: 1.125rem;
}

/* Mobile overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 30;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Tablet styles */
@media (min-width: 769px) and (max-width: 1024px) {
    #sidebar.sidebar-expanded {
        width: 16rem; /* Keep consistent with desktop */
    }
    
    .sidebar-nav {
        padding: 0.75rem 0.5rem;
    }
    
    .sidebar-nav-link {
        padding: 0.625rem;
    }
    
    .sidebar-nav-icon {
        width: 1.75rem;
        height: 1.75rem;
        margin-right: 0.625rem;
    }
    
    /* Show tablet-specific controls */
    .sidebar-controls {
        gap: 0.375rem;
    }
    
    .sidebar-control-btn {
        padding: 0.375rem;
        font-size: 0.875rem;
    }
}

/* Large screen styles */
@media (min-width: 1025px) {
    #sidebar {
        /* Ensure smooth transitions on large screens */
        will-change: transform, width;
    }
    
    /* Hover effects for desktop */
    #sidebar.sidebar-icon-only:hover {
        width: 16rem;
    }
    
    #sidebar.sidebar-icon-only:hover .sidebar-logo-text,
    #sidebar.sidebar-icon-only:hover .sidebar-nav-text,
    #sidebar.sidebar-icon-only:hover .sidebar-dropdown-title {
        opacity: 1;
        width: auto;
        overflow: visible;
    }
    
    /* Enhanced desktop controls */
    .sidebar-controls {
        gap: 0.75rem;
    }
    
    .sidebar-control-btn {
        padding: 0.625rem;
        font-size: 1rem;
    }
}

/* Extra large screens */
@media (min-width: 1440px) {
    #sidebar.sidebar-expanded {
        width: 18rem; /* Slightly larger on very large screens */
    }
    
    .sidebar-nav-link {
        padding: 0.875rem;
        font-size: 1rem;
    }
    
    .sidebar-nav-icon {
        width: 2.25rem;
        height: 2.25rem;
        margin-right: 1rem;
    }
}

/* ===== ANIMATIONS AND TRANSITIONS ===== */

/* Slide animations */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

.sidebar-slide-in {
    animation: slideInLeft 0.3s ease-out;
}

.sidebar-slide-out {
    animation: slideOutLeft 0.3s ease-in;
}

/* Fade animations for text elements */
.sidebar-text-fade {
    transition: opacity 0.3s ease, width 0.3s ease;
}

.sidebar-text-fade.hidden {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* ===== SCROLLBAR STYLING ===== */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.dark .sidebar-nav::-webkit-scrollbar-thumb {
    background: #4b5563;
}

.dark .sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* ===== UTILITY CLASSES ===== */
.sidebar-hidden {
    transform: translateX(-100%) !important;
}

.sidebar-visible {
    transform: translateX(0) !important;
}

.sidebar-icon-mode {
    width: 3rem !important;
}

.sidebar-expanded-mode {
    width: 16rem !important;
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    #sidebar,
    .sidebar-nav-link,
    .sidebar-dropdown-content,
    .sidebar-logo-text,
    .sidebar-nav-text {
        transition: none;
        animation: none;
    }
}

/* Focus states for keyboard navigation */
.sidebar-nav-link:focus,
.sidebar-control-btn:focus,
.sidebar-dropdown-trigger:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.dark .sidebar-nav-link:focus,
.dark .sidebar-control-btn:focus,
.dark .sidebar-dropdown-trigger:focus {
    outline-color: #60a5fa;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    #sidebar {
        border-right-width: 2px;
    }
    
    .sidebar-nav-link:hover,
    .sidebar-nav-link.active {
        border: 1px solid currentColor;
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
@media (prefers-reduced-motion: no-preference) {
    #sidebar {
        /* Hardware acceleration for smooth animations */
        transform: translateZ(0);
        backface-visibility: hidden;
        perspective: 1000px;
    }
    
    .sidebar-nav-link,
    .sidebar-control-btn,
    .sidebar-dropdown-trigger {
        /* Optimize transitions */
        will-change: transform, background-color, color;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    #sidebar,
    .sidebar-overlay,
    .sidebar-toggle-mobile,
    .sidebar-close-mobile {
        display: none !important;
    }
}

/* ===== LANDSCAPE MOBILE OPTIMIZATION ===== */
@media (max-width: 768px) and (orientation: landscape) {
    #sidebar {
        max-height: 100vh;
        overflow-y: auto;
    }
    
    .sidebar-header {
        padding: 1rem;
    }
    
    .sidebar-nav {
        padding: 0.5rem;
    }
    
    .sidebar-nav-link {
        padding: 0.5rem 0.75rem;
    }
    
    .sidebar-nav-icon {
        width: 1.75rem;
        height: 1.75rem;
        margin-right: 0.75rem;
    }
}
