/**
 * AGROSED 2026 - Dark Mode Toggle Component
 * Modern theme switcher with smooth transitions
 */

/* ============================================================================
   THEME TOGGLE BUTTON
   ============================================================================ */

.theme-toggle {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-full);
    padding: var(--space-1);
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.theme-toggle:hover {
    background: var(--neutral-200);
}

.theme-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--neutral-300);
    border-radius: var(--border-radius-full);
    transition: all var(--transition-base);
}

.theme-toggle input:checked + .theme-toggle-slider {
    background: var(--primary-600);
}

.theme-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: var(--border-radius-full);
    top: 3px;
    left: 3px;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.theme-toggle input:checked + .theme-toggle-slider::before {
    transform: translateX(20px);
}

.theme-toggle-icons {
    position: absolute;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 var(--space-1);
    pointer-events: none;
}

.theme-toggle-icon {
    font-size: 12px;
    transition: all var(--transition-fast);
}

.theme-toggle-icon.sun {
    color: var(--warning-400);
}

.theme-toggle-icon.moon {
    color: var(--primary-400);
}

.theme-toggle input:checked ~ .theme-toggle-icons .sun {
    opacity: 0.4;
}

.theme-toggle input:not(:checked) ~ .theme-toggle-icons .moon {
    opacity: 0.4;
}

/* ============================================================================
   DARK MODE SPECIFIC ADJUSTMENTS
   ============================================================================ */

[data-theme="dark"] {
    /* Adjust component backgrounds */
    color-scheme: dark;
}

[data-theme="dark"] .sidebar {
    box-shadow: var(--shadow-xl);
}

[data-theme="dark"] .top-navbar {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .card {
    background: var(--neutral-800);
    border-color: var(--neutral-700);
}

[data-theme="dark"] .table thead {
    background: var(--neutral-800);
}

[data-theme="dark"] .table tbody tr:hover {
    background: var(--neutral-800);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea {
    background: var(--neutral-800);
    border-color: var(--neutral-700);
    color: var(--text-primary);
}

[data-theme="dark"] .btn-secondary {
    background: var(--neutral-700);
    border-color: var(--neutral-600);
    color: var(--text-primary);
}

[data-theme="dark"] .btn-secondary:hover {
    background: var(--neutral-600);
}

/* ============================================================================
   SMOOTH THEME TRANSITIONS
   ============================================================================ */

* {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-duration: var(--transition-base);
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Exclude transitions for specific elements */
.loading-spinner,
.animate-spin,
.animate-pulse,
.animate-bounce {
    transition: none !important;
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
    .sidebar,
    .top-navbar,
    .btn,
    .theme-toggle,
    .notification-menu,
    .user-menu {
        display: none !important;
    }
    
    .main-wrapper {
        margin-left: 0 !important;
    }
    
    .page-content {
        padding: 0 !important;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none !important;
    }
}


