/* Import color variables */
@import 'colors.css';

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: var(--background-color);
    color: var(--neutral-text-color);
    transition: all 0.3s ease;
    margin: 0;
    padding: 0;
}

/* Auth page container - Enhanced centering */
.auth-page {
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile browsers */
    width: 100vw;
    background: var(--login-bg-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden;
    padding: 1rem;
}

/* Settings Dropdown */
.settings-dropdown {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
}

.settings-toggle-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow-color) 0px 4px 12px;
    color: var(--neutral-text-color);
}

.settings-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-hover-shadow-color) 0px 8px 25px;
}

.settings-toggle-btn.active {
    background: var(--primary-color);
    color: white;
    transform: rotate(90deg);
}

.settings-panel {
    position: absolute;
    top: 60px;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--card-shadow-color) 0px 8px 25px;
    padding: 1rem;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.settings-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.settings-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--neutral-text-color);
    font-size: 0.9rem;
    font-weight: 500;
}

.settings-label i {
    color: var(--primary-color);
    width: 16px;
}

/* Theme Switch */
.theme-switch {
    position: relative;
}

.theme-checkbox {
    display: none;
}

.theme-slider {
    display: block;
    width: 50px;
    height: 26px;
    background: var(--toggle-off-bg);
    border-radius: 13px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: relative;
}

.theme-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-checkbox:checked + .theme-slider {
    background: var(--toggle-on-bg);
}

.theme-checkbox:checked + .theme-slider::before {
    transform: translateX(24px);
}

.theme-slider-icons {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 4px;
    font-size: 0.7rem;
    pointer-events: none;
}

.theme-slider-icons .light-icon {
    color: #fbbf24;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.theme-slider-icons .dark-icon {
    color: #1f2937;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.theme-checkbox:checked + .theme-slider .light-icon {
    opacity: 0;
}

.theme-checkbox:checked + .theme-slider .dark-icon {
    opacity: 1;
}

/* Auth container - Perfect centering */
.auth-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Background decorative elements - Enhanced with more circles */
.auth-bg-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(var(--primary-color-rgb), 0.06);
    animation: float 8s ease-in-out infinite;
    pointer-events: none;
    opacity: 0.8;
}

/* More circles with varied sizes and positions */
.circle-1 {
    width: 250px;
    height: 250px;
    top: 5%;
    left: -8%;
    animation-delay: 0s;
    background: rgba(var(--primary-color-rgb), 0.08);
}

.circle-2 {
    width: 180px;
    height: 180px;
    top: 65%;
    right: -5%;
    animation-delay: 2s;
    background: rgba(var(--primary-color-rgb), 0.06);
}

.circle-3 {
    width: 120px;
    height: 120px;
    top: 25%;
    left: 88%;
    animation-delay: 4s;
    background: rgba(var(--primary-color-rgb), 0.07);
}

.circle-4 {
    width: 200px;
    height: 200px;
    top: 40%;
    left: -10%;
    animation-delay: 1s;
    background: rgba(var(--primary-color-rgb), 0.05);
}

.circle-5 {
    width: 150px;
    height: 150px;
    top: 15%;
    right: 15%;
    animation-delay: 3s;
    background: rgba(var(--primary-color-rgb), 0.06);
}

.circle-6 {
    width: 100px;
    height: 100px;
    top: 80%;
    left: 10%;
    animation-delay: 5s;
    background: rgba(var(--primary-color-rgb), 0.08);
}

.circle-7 {
    width: 80px;
    height: 80px;
    top: 10%;
    left: 25%;
    animation-delay: 6s;
    background: rgba(var(--primary-color-rgb), 0.07);
}

.circle-8 {
    width: 140px;
    height: 140px;
    top: 85%;
    right: 20%;
    animation-delay: 2.5s;
    background: rgba(var(--primary-color-rgb), 0.05);
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg) scale(1); }
    25% { transform: translateY(-15px) rotate(5deg) scale(1.05); }
    50% { transform: translateY(-25px) rotate(10deg) scale(1.1); }
    75% { transform: translateY(-10px) rotate(5deg) scale(1.05); }
}

/* Login container - Enhanced centering */
.login-container {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--card-shadow-color) 0px 20px 40px;
    padding: 3rem 2.5rem;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    z-index: 100;
    width: 100%;
    margin: 0 auto;
}

.login-container:hover {
    box-shadow: var(--card-hover-shadow-color) 0px 25px 50px;
    transform: translateY(-5px);
}

/* Login header */
.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-container {
    margin-bottom: 2rem;
}

.auth-logo {
    width: 180px;
    height: 180px;
    object-fit: contain;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
    transition: transform 0.4s ease;
    margin-bottom: -75px;
    margin-top: -50px;
}

.auth-logo:hover {
    transform: scale(1.08) rotate(5deg);
}

.welcome-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--header-text-color);
    margin-bottom: 0.5rem;
}

.welcome-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 400;
}

/* Login form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    z-index: 2;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.input-group input {
    width: 100%;
    padding: 1rem 3rem 1rem 3rem;
    border: 2px solid var(--input-border-color);
    border-radius: 12px;
    font-size: 1rem;
    background-color: var(--input-bg);
    color: var(--neutral-text-color);
    transition: all 0.3s ease;
    outline: none;
}

/* Hide browser's default password reveal button */
.input-group input[type="password"]::-ms-reveal,
.input-group input[type="password"]::-ms-clear {
    display: none;
}

.input-group input[type="password"]::-webkit-credentials-auto-fill-button {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
    position: absolute;
    right: 0;
}

.input-group input[type="text"]::-webkit-credentials-auto-fill-button {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
    position: absolute;
    right: 0;
}

.input-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(var(--primary-color-rgb), 0.1);
    transform: translateY(-2px);
}

.input-group input:focus + .input-icon,
.input-group:hover .input-icon {
    color: var(--primary-color);
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 10;
    padding: 0.5rem;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.password-toggle:hover {
    color: var(--primary-color);
    background-color: rgba(var(--primary-color-rgb), 0.1);
}

.password-toggle:focus {
    outline: 2px solid rgba(var(--primary-color-rgb), 0.3);
    outline-offset: 1px;
}

/* Login button */
.login-button {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-dark));
    color: var(--button-text-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(var(--primary-color-rgb), 0.3);
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--primary-color-rgb), 0.4);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.button-text {
    display: inline-block;
    transition: opacity 0.3s ease;
}

.button-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Messages */
.error-message, .success-message {
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    display: none;
}

.error-message {
    background-color: var(--error-bg-color);
    color: var(--error-text-color);
    border: 1px solid var(--error-border-color);
}

.success-message {
    background-color: var(--success-bg-color);
    color: var(--success-text-color);
    border: 1px solid var(--success-border-color);
}

.error-message.show, .success-message.show {
    display: block;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login footer */
.login-footer {
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Enhanced responsive design for perfect centering */
@media (max-width: 768px) {
    .auth-page {
        padding: 0.5rem;
    }

    .settings-dropdown {
        top: 1rem;
        right: 1rem;
    }
    
    .settings-toggle-btn {
        width: 40px;
        height: 40px;
    }

    .settings-panel {
        top: 50px;
        min-width: 180px;
    }
    
    .auth-container {
        max-width: 100%;
    }
    
    .login-container {
        padding: 2rem 1.5rem;
        border-radius: 16px;
        margin: 0;
    }
    
    .welcome-title {
        font-size: 1.6rem;
    }
    
    .auth-logo {
        width: 130px;
        height: 130px;
    }
    
    .login-form {
        gap: 1.2rem;
    }
    
    .input-group input {
        padding: 0.9rem 2.8rem 0.9rem 2.8rem;
    }
    
    .login-button {
        padding: 0.9rem;
        font-size: 1rem;
    }

    .password-toggle {
        right: 0.5rem;
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    /* Responsive circles */
    .circle-1 { width: 180px; height: 180px; }
    .circle-2 { width: 130px; height: 130px; }
    .circle-3 { width: 90px; height: 90px; }
    .circle-4 { width: 150px; height: 150px; }
    .circle-5 { width: 110px; height: 110px; }
    .circle-6 { width: 80px; height: 80px; }
    .circle-7 { width: 60px; height: 60px; }
    .circle-8 { width: 100px; height: 100px; }
}

@media (max-width: 480px) {
    .auth-page {
        padding: 0.25rem;
    }

    .login-container {
        padding: 1.5rem 1rem;
        border-radius: 12px;
    }
    
    .welcome-title {
        font-size: 1.4rem;
    }

    .auth-logo {
        width: 110px;
        height: 110px;
    }

    .password-toggle {
        right: 0.4rem;
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }

    .settings-panel {
        min-width: 160px;
    }

    /* Smaller circles for mobile */
    .circle-1 { width: 150px; height: 150px; }
    .circle-2 { width: 100px; height: 100px; }
    .circle-3 { width: 70px; height: 70px; }
    .circle-4 { width: 120px; height: 120px; }
    .circle-5 { width: 90px; height: 90px; }
    .circle-6 { width: 60px; height: 60px; }
    .circle-7 { width: 50px; height: 50px; }
    .circle-8 { width: 80px; height: 80px; }
}

/* Extra small devices */
@media (max-width: 360px) {
    .auth-page {
        padding: 0.125rem;
    }

    .login-container {
        padding: 1.25rem 0.75rem;
    }

    .welcome-title {
        font-size: 1.25rem;
    }

    .auth-logo {
        width: 90px;
        height: 90px;
    }
}

/* Large screens and ultrawide monitors */
@media (min-width: 1920px) {
    .auth-container {
        max-width: 500px;
    }

    .login-container {
        padding: 3.5rem 3rem;
    }

    .auth-logo {
        width: 200px;
        height: 200px;
    }

    .welcome-title {
        font-size: 2.2rem;
    }
}

/* Very tall screens */
@media (min-height: 1080px) {
    .auth-logo {
        margin-bottom: -50px;
        margin-top: -25px;
    }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .auth-page {
        padding: 0.25rem;
    }

    .login-container {
        padding: 1rem;
    }

    .auth-logo {
        width: 60px;
        height: 60px;
        margin-bottom: -25px;
        margin-top: -15px;
    }

    .welcome-title {
        font-size: 1.2rem;
    }

    .logo-container {
        margin-bottom: 1rem;
    }

    .login-form {
        gap: 1rem;
    }
}

/* Animation for page load */
.login-container {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dark mode specific adjustments */
.dark-mode .auth-page {
    background: var(--login-bg-gradient);
}

.dark-mode .login-container {
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
}

.dark-mode .bg-circle {
    background: rgba(var(--primary-color-rgb), 0.04);
} 