:root {
    /* Light Theme Colors */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-rgb: 37, 99, 235;
    --secondary-color: #64748b;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --error-color: #ef4444;
    --success-color: #10b981;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    /* Dark Theme Colors */
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-rgb: 59, 130, 246;
    --secondary-color: #94a3b8;
    --background: #0f172a;
    --surface: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border-color: #334155;
    --error-color: #f87171;
    --success-color: #34d399;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Modern Scrollbars — Global */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

/* Webkit (Chrome, Edge, Safari) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.6);
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:active {
    background: rgba(100, 116, 139, 0.7);
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-corner {
    background: transparent;
}

[data-theme="dark"] {
    scrollbar-color: rgba(148, 163, 184, 0.2) transparent;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.2);
    border: 2px solid transparent;
    background-clip: padding-box;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.4);
    border: 2px solid transparent;
    background-clip: padding-box;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:active {
    background: rgba(148, 163, 184, 0.55);
    border: 2px solid transparent;
    background-clip: padding-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.login-container {
    width: 100%;
    max-width: 450px;
    position: relative;
}

.login-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo-container img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.login-header .logo-container img {
    width: 28px;
    height: 28px;
    max-width: 28px;
    max-height: 28px;
}

.login-logo {
    width: 52px;
    height: 52px;
    max-width: 52px;
    max-height: 52px;
    object-fit: contain;
}

.logo-container i {
    font-size: 32px;
    color: var(--primary-color);
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    animation: slideDown 0.3s ease;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    color: var(--primary-color);
    font-size: 14px;
}

.form-group input:not([type="checkbox"]),
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    background: var(--surface) !important;
    background-color: var(--surface) !important;
    color: var(--text-primary) !important;
    transition: all 0.3s ease;
    font-family: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Select dropdown options styling */
.form-group select option {
    background: var(--surface) !important;
    background-color: var(--surface) !important;
    color: var(--text-primary) !important;
    padding: 10px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary);
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--primary-color);
}

.checkbox-group {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-primary:active {
    transform: translateY(0);
}

.login-footer {
    margin-top: 32px;
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    font-size: 12px;
    color: var(--text-secondary);
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    z-index: 1000;
}

.theme-toggle:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-card {
        padding: 32px 24px;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
    
    .logo-container i {
        font-size: 28px;
    }
    
    .theme-toggle {
        width: 44px;
        height: 44px;
        top: 16px;
        right: 16px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 16px;
    }
    
    .login-card {
        padding: 24px 20px;
        border-radius: 12px;
    }
    
    .login-header h1 {
        font-size: 22px;
    }
    
    .checkbox-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .theme-toggle {
        width: 40px;
        height: 40px;
        top: 12px;
        right: 12px;
        font-size: 16px;
    }
}

/* Loading state */
.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Select dropdown styling */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-color: var(--surface) !important;
    padding-right: 40px;
    cursor: pointer;
    color: var(--text-primary) !important;
    border: 2px solid var(--border-color) !important;
}

[data-theme="dark"] select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23cbd5e1' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-color: var(--surface) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* Select dropdown options - ensure visibility in both themes */
select option {
    background-color: var(--surface) !important;
    background: var(--surface) !important;
    color: var(--text-primary) !important;
    padding: 10px;
}

/* Dark mode specific option styling */
[data-theme="dark"] select option {
    background-color: #1e293b !important;
    background: #1e293b !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] select option:checked,
[data-theme="dark"] select option:hover {
    background-color: var(--primary-color) !important;
    background: var(--primary-color) !important;
    color: white !important;
}

/* For browsers that support styling option elements */
select option:checked {
    background-color: var(--primary-color);
    color: white;
}

select option:hover {
    background-color: var(--primary-color);
    color: white;
}

