:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success-color: #22c55e;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-secondary: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

[data-theme="dark"] {
    --primary-color: #6366f1;
    --primary-hover: #7c3aed;
    --secondary-color: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #374151;
    --gradient-secondary: linear-gradient(135deg, #1e293b 0%, #374151 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--gradient-secondary);
    color: var(--text-primary);
    transition: all 0.3s ease;
    overflow: hidden;
    /* Prevent scrolling */
    height: 100vh;
    margin: 0;
    padding: 0;
}

/* Dark mode text-muted override */
[data-theme="dark"] .text-muted {
    color: rgba(248, 250, 252, 0.7) !important;
    /* White text in dark mode */
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.theme-btn {
    width: 50px;
    height: 50px;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Login Section */
.login-section {
    background: var(--gradient-secondary);
    padding: 2rem;
    height: 100vh;
    overflow-y: auto;
    /* Allow scrolling only in login section if needed */
    overflow-x: hidden;
}

.login-container {
    max-width: 450px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    padding: 2.5rem 2rem;
    /* Reduced padding */
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    transform-origin: center center;
    margin: auto;
    /* Center vertically */
}

[data-theme="dark"] .login-container {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: var(--gradient-primary);
    border-radius: 50%;
    font-size: 2rem;
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    }
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
}

/* Form Styles */
.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.input-group {
    position: relative;
    width: 100%;
    /* Full width */
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    /* background-color: var(--primary-color); */
    color: var(--text-secondary);
    z-index: 50;
    pointer-events: none;
}

.custom-input {
    width: 100%;
    /* Full width */
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid var(--border-color);
    border-radius: 12px !important;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-primary);
}

[data-theme="dark"] .custom-input {
    color: #f8fafc;
    /* White text in dark mode */
    background: rgba(30, 41, 59, 0.8);
    border-color: var(--border-color);
}

[data-theme="dark"] .custom-input::placeholder {
    color: rgba(248, 250, 252, 0.5);
    /* Light placeholder in dark mode */
}

/* [data-theme="dark"] .input-icon {
    color: var(--text-secondary);
} */

.custom-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: rgba(255, 255, 255, 1);
    outline: none;
}

[data-theme="dark"] .custom-input:focus {
    color: #f8fafc;
    /* Keep white text on focus */
    background: rgba(30, 41, 59, 1);
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    background: none;
    transform: translateY(-50%);
    border: none;
    color: var(--text-secondary);
    z-index: 5;
    padding: 0;
    width: auto;
    height: auto;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.forgot-password:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Login Button */
.btn-login {
    background: var(--gradient-primary);
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    /* Ensure proper positioning context for spinner */
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-login:active {
    transform: translateY(0);
}

/* Dashboard Section */
.dashboard-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    height: 100vh;
}

[data-theme="dark"] .dashboard-section {
    background: linear-gradient(135deg, #4c1d95 0%, #5b21b6 100%);
}

.dashboard-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem 2rem;
    position: relative;
    z-index: 2;
    width: 100%;
    /* Match parent width */
    height: 100%;
    /* Match parent height */
    overflow: hidden;
}

/* Animated Background Shapes */
.bg-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    /* Behind everything */
    pointer-events: none;
    /* Don't interfere with clicks */
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    /* More subtle */
    backdrop-filter: blur(10px);
    animation: float 20s infinite ease-in-out;
    pointer-events: none;
}

.shape-1 {
    width: 250px;
    /* Reduced size */
    height: 250px;
    top: -80px;
    right: -80px;
    animation-delay: 0s;
}

.shape-2 {
    width: 180px;
    /* Reduced size */
    height: 180px;
    bottom: 15%;
    left: -60px;
    animation-delay: 5s;
}

.shape-3 {
    width: 120px;
    /* Reduced size */
    height: 120px;
    top: 45%;
    right: 5%;
    animation-delay: 10s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-30px) rotate(90deg);
    }

    50% {
        transform: translateY(-60px) rotate(180deg);
    }

    75% {
        transform: translateY(-30px) rotate(270deg);
    }
}

/* Brand Header */
.brand-header {
    text-align: center;
    z-index: 2;
    position: relative;
    margin-bottom: 2rem;
    flex-shrink: 0;
}

.brand-logo-container {
    margin-bottom: 1rem;
}

.brand-logo {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
    animation: fadeInDown 0.6s ease-out;
}

.brand-name {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
    animation: fadeInDown 0.6s ease-out 0.2s both;
}

.brand-tagline {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    animation: fadeInDown 0.6s ease-out 0.4s both;
}

/* Features Container */
.features-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    animation: fadeInLeft 0.6s ease-out both;
    flex-shrink: 0;
}

.feature-item:nth-child(1) {
    animation-delay: 0.6s;
}

.feature-item:nth-child(2) {
    animation-delay: 0.8s;
}

.feature-item:nth-child(3) {
    animation-delay: 1s;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.feature-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

.feature-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.25rem;
}

.feature-content p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    line-height: 1.4;
}

/* Dashboard Footer */
.dashboard-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.dashboard-footer p {
    margin: 0;
}

/* Mobile Logo */
.mobile-logo {
    display: none;
}

.mobile-logo-img {
    height: 60px;
    width: auto;
    margin-bottom: 1rem;
}

.mobile-brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0;
}

/* Footer Credit */
.footer-credit {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.footer-credit p {
    line-height: 1.6;
}

.footer-credit strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Toast Styles */
.toast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

[data-theme="dark"] .toast {
    background: rgba(30, 41, 59, 0.95);
}

/* Responsive Design */

/* 4K Displays */
@media (min-width: 2560px) {
    .login-container {
        max-width: 500px;
        padding: 4rem 3rem;
    }

    .login-title {
        font-size: 2.5rem;
    }

    .brand-name {
        font-size: 3.5rem;
    }

    .slide-content {
        height: 500px;
    }
}

/* 2K Displays */
@media (min-width: 1920px) and (max-width: 2559px) {
    .login-container {
        max-width: 450px;
        padding: 3.5rem 2.75rem;
    }

    .login-title {
        font-size: 2.25rem;
    }

    .brand-name {
        font-size: 3rem;
    }

    .slide-content {
        height: 450px;
    }
}

/* Tablet */
@media (max-width: 991.98px) {
    .login-section {
        padding: 1.5rem;
    }

    .login-container {
        padding: 2rem 1.5rem;
    }

    .brand-name {
        font-size: 2rem;
    }

    .slide-content {
        height: 300px;
    }
}

/* Mobile */
@media (max-width: 767.98px) {
    .theme-toggle {
        top: 15px;
        left: 15px;
    }

    .theme-btn {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }

    .login-section {
        padding: 1rem;
        height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow-y: auto;
    }

    .login-container {
        max-width: 100%;
        padding: 1.5rem 1rem;
        margin: auto;
    }

    .login-title {
        font-size: 1.75rem;
    }

    .login-subtitle {
        font-size: 0.9rem;
    }

    .custom-input {
        padding: 0.875rem 1rem 0.875rem 2.5rem;
        font-size: 1rem;
    }

    .btn-login {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
}

/* Small Mobile */
@media (max-width: 575.98px) {
    .login-container {
        padding: 1.5rem 1rem;
        border-radius: 15px;
    }

    .login-title {
        font-size: 1.5rem;
    }

    .custom-input {
        padding: 0.75rem 1rem 0.75rem 2.25rem;
    }

    .input-icon {
        left: 12px;
    }

    .password-toggle {
        right: 12px;
    }
}

/* Loading State - Simplified and Clean */
.btn-login {
    position: relative;
}

.btn-login .login-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0 !important;
}

.btn-login .login-spinner.d-none {
    display: none !important;
}

.btn-login.loading {
    pointer-events: none;
}

.btn-login.loading .login-text {
    opacity: 0;
}

.btn-login.loading .login-spinner {
    display: inline-block !important;
}

/* Animation Classes */
.fade-in {
    /* Use a centered scale + fade to avoid any diagonal slip on some browsers/layouts */
    animation: fadeInScale 260ms cubic-bezier(.2, .9, .2, 1) both;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.985) translateY(6px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}