/* ================================================
   LOGIN OVERLAY STYLES
   Purple Theme
   ================================================ */

/* Overlay Container */
#login-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

#login-overlay.show {
    display: flex;
}

/* Login Card */
.login-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 400px;
    width: 90%;
}

.login-card h2 {
    margin: 0 0 24px 0;
    color: #1F2937;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
}

/* Login Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-form input {
    padding: 14px 16px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
    background: #F9FAFB;
}

.login-form input:focus {
    outline: none;
    border-color: #7C3AED;
    background: white;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.login-form input::placeholder {
    color: #9CA3AF;
}

.login-form button {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

/* Button Styles */
.login-form .login-btn {
    background: #7C3AED;
    color: white;
}

.login-form .login-btn:hover {
    background: #6D28D9;
}

.login-form .register-btn {
    background: #F5F3FF;
    color: #7C3AED;
    border: 1px solid #E9D5FF;
}

.login-form .register-btn:hover {
    background: #EDE9FE;
}

.login-form .close-btn {
    background: #F3F4F6;
    color: #6B7280;
    margin-top: 4px;
}

.login-form .close-btn:hover {
    background: #E5E7EB;
}

/* Message Display */
#login-message {
    padding: 12px 16px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 16px;
    display: none;
    font-size: 14px;
}

#login-message.error {
    background-color: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FECACA;
    display: block;
}

#login-message.success {
    background-color: #F0FDF4;
    color: #16A34A;
    border: 1px solid #BBF7D0;
    display: block;
}

/* User Info Display in Nav */
.user-info {
    display: none;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #6B7280;
}

.user-info.show {
    display: flex;
}

#userEmail {
    font-weight: 500;
    color: #374151;
}

/* Header Controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Open Login Button (in nav) */
.open-login-btn,
.nav-btn.login-btn {
    padding: 8px 16px;
    background: #7C3AED;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.open-login-btn:hover,
.nav-btn.login-btn:hover {
    background: #6D28D9;
}

/* Logout Button (small, in nav) */
.logout-btn-small,
.nav-btn.logout-btn {
    padding: 8px 16px;
    background: #F3F4F6;
    color: #6B7280;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.logout-btn-small:hover,
.nav-btn.logout-btn:hover {
    background: #E5E7EB;
    color: #374151;
}

/* Favorites Filter Container */
#favoritesFilterContainer {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #F9FAFB;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    border: 1px solid #E5E7EB;
    transition: all 0.2s;
}

#favoritesFilterContainer:hover {
    border-color: #7C3AED;
}

#favoritesFilterContainer input {
    accent-color: #7C3AED;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Show favorites filter when logged in */
.user-info.show ~ #favoritesFilterContainer,
body.logged-in #favoritesFilterContainer {
    display: flex;
}

/* Resend Verification Email Button */
.resend-btn {
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #7C3AED;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.resend-btn:hover {
    background-color: #6D28D9;
}

.resend-btn:active {
    transform: scale(0.98);
}

/* ================================================
   ENHANCED LOGIN/REGISTRATION FORM STYLES
   ================================================ */

/* Form Buttons Container */
.form-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Form Links Container */
.form-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    font-size: 13px;
}

.form-link-separator {
    color: #D1D5DB;
}

.forgot-password-link,
.toggle-register-link,
.back-to-login-link {
    color: #7C3AED;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-password-link:hover,
.toggle-register-link:hover,
.back-to-login-link:hover {
    color: #6D28D9;
    text-decoration: underline;
}

/* Forgot Password Form */
.forgot-password-form {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.form-description {
    color: #6B7280;
    font-size: 14px;
    text-align: center;
    margin: 0 0 8px 0;
}

/* Reset Password Button */
.login-form .reset-btn {
    background: #7C3AED;
    color: white;
}

.login-form .reset-btn:hover {
    background: #6D28D9;
}

.back-to-login-link {
    display: block;
    text-align: center;
    margin-bottom: 8px;
}

/* Username Suggestion Buttons */
.username-suggestion-btn {
    display: inline-block;
    margin: 4px;
    padding: 8px 16px;
    background: #F5F3FF;
    color: #7C3AED;
    border: 1px solid #E9D5FF;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.username-suggestion-btn:hover {
    background: #7C3AED;
    color: white;
    border-color: #7C3AED;
}

/* Registration Mode Enhancements */
.login-card h2 {
    transition: color 0.2s;
}

/* Create Account Title - more prominent */
.login-card h2#form-title {
    font-size: 24px;
    font-weight: 700;
}

/* Username input styling */
#username-input {
    background: #FEFCE8;
    border-color: #FEF08A;
}

#username-input:focus {
    border-color: #FACC15;
    box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.2);
}

#username-input::placeholder {
    color: #A3A3A3;
    font-size: 13px;
}

/* Confirm Password Input */
#confirm-password-input {
    background: #F9FAFB;
}

/* Message box enhancements for multi-line content */
#login-message {
    white-space: pre-wrap;
    line-height: 1.5;
}

#login-message strong {
    display: block;
    margin: 8px 0 4px 0;
}

/* Responsive adjustments - Tablet */
@media (max-width: 768px) {
    .login-card {
        padding: 32px;
        max-width: 380px;
    }

    .login-card h2 {
        font-size: 22px;
    }

    .login-form input {
        padding: 12px 14px;
        font-size: 14px;
    }

    .login-form button {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* Responsive adjustments - Small screens */
@media (max-width: 480px) {
    .login-card {
        padding: 24px 20px;
        width: 95%;
        max-width: 100%;
        border-radius: 12px;
    }

    .login-card h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .login-form {
        gap: 10px;
    }

    .login-form input {
        padding: 12px;
        font-size: 14px;
        border-radius: 6px;
    }

    .login-form button {
        padding: 12px 16px;
        font-size: 14px;
        border-radius: 6px;
    }

    #login-message {
        font-size: 13px;
        padding: 10px 12px;
    }

    .form-links {
        flex-direction: column;
        gap: 4px;
    }

    .form-link-separator {
        display: none;
    }

    .forgot-password-link,
    .toggle-register-link,
    .back-to-login-link {
        font-size: 13px;
    }

    .form-description {
        font-size: 13px;
    }

    .username-suggestion-btn {
        display: block;
        width: 100%;
        margin: 4px 0;
        padding: 10px 16px;
        font-size: 13px;
    }

    .resend-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}
