/* Authentication Modal Styles */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.auth-card {
    width: 90%;
    max-width: 400px;
    margin: 0;
    text-align: center;
    position: relative;
    animation: authSlideUp 0.4s ease;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    margin-bottom: 2rem;
    padding: 4px;
    position: relative;
    border: 1px solid var(--card-border);
}

.auth-tab {
    flex: 1;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 0.8rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    position: relative;
    z-index: 2;
}

.auth-tab.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-plane {
    animation: planeFadeIn 0.4s ease;
}

@keyframes planeFadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes authSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff, #a0a0b0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-card p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.auth-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.8rem 1rem;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
    color-scheme: dark;
}

.auth-input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
}

select.auth-input option {
    background-color: #0b0f19;
    color: #f8fafc;
}

/* Chrome/Safari Autofill fix */
.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0px 1000px #1a1a24 inset;
    /* Match theme color */
    transition: background-color 5000s ease-in-out 0s;
}

/* Hide default browser password reveal and clear icons */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none !important;
}

input[type="password"]::-webkit-credentials-reveal,
input[type="password"]::-webkit-password-toggle {
    display: none !important;
}

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

.password-input-wrapper .auth-input {
    padding-right: 75px; /* Space for both buttons */
}

.toggle-password-btn, .clear-password-btn {
    position: absolute;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
}

.toggle-password-btn {
    right: 40px;
}

.clear-password-btn {
    right: 10px;
}

.toggle-password-btn:hover, .clear-password-btn:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

.clear-password-btn:hover {
    color: #ef4444; /* Give delete a slight red hint on hover */
}

.password-constraints {
    text-align: left;
    margin-top: 10px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding-left: 5px;
}

.password-constraints p {
    margin: 2px 0 !important;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
}

.password-constraints p::before {
    content: '○';
    font-size: 0.8rem;
}

.password-constraints p.valid {
    color: var(--success);
}

.password-constraints p.valid::before {
    content: '●';
}

.auth-divider {
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--card-border);
}

.auth-divider span {
    padding: 0 10px;
}

.google-btn {
    width: 100%;
    padding: 0.8rem;
    background: #ffffff;
    color: #3c4043;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.2s, box-shadow 0.2s;
}

.google-btn:hover {
    background: #f1f3f4;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3);
}

.google-icon {
    width: 20px;
    height: 20px;
}

.auth-error-message {
    color: var(--danger) !important;
    margin-top: 1rem !important;
    margin-bottom: 0 !important;
    font-size: 0.9rem;
    text-align: center;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.header-titles h1 {
    font-size: 2.5rem;
}

.log-out-btn {
    width: auto;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}

/* User Profile Dropdown */
.user-profile-dropdown {
    position: relative;
    display: inline-block;
}

.user-info-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    font-weight: 500;
}

.user-info-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
}

.dropdown-chevron {
    font-size: 0.7rem;
    opacity: 0.7;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 110%;
    min-width: 200px;
    background: rgba(20, 20, 25, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    overflow: hidden;
    padding: 5px;
}

.user-profile-dropdown:hover .dropdown-content,
.user-profile-dropdown.active .dropdown-content {
    display: block;
    animation: dropdownSlide 0.2s ease-out forwards;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-content button {
    width: 100%;
    padding: 0.8rem 1rem;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.1s;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-content button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.sign-out-dropdown-btn:hover {
    color: #ef4444 !important;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 1.5rem;
}

.modal-actions button {
    flex: 1;
}

.glow-btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--card-border);
}

.glow-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

/* Close Button for Auth Modal */
.auth-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 5px;
    transition: color 0.2s, transform 0.2s;
    z-index: 100;
}

.auth-close-btn:hover {
    color: #fff;
    transform: scale(1.1);
}

/* Password Reset Styles */
.forgot-password-link {
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-block;
}

.forgot-password-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

.auth-success-message {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    font-size: 0.88rem;
    line-height: 1.5;
    text-align: center;
    backdrop-filter: blur(8px);
}

.secondary-link {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.secondary-link:hover {
    color: #fff;
}
