
/* auth.css - Authentication UI styles */

/* Auth Modal */
.auth-container {
    width: 100%;
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 2rem;
}

.auth-tab {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    font-size: 1rem;
}

.auth-tab:hover {
    color: var(--text-dark);
}

.auth-tab.active {
    color: var(--primary);
    border-bottom-color: var(--accent);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-profile-btn {
    position: relative;  /* Creates positioning context */
}

/* User Menu Dropdown */
.user-menu {
    position: absolute;
    top: calc(100% + 0.5rem);  /* Below button */
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 1000;
}

.user-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.user-menu a:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.user-menu a:first-child {
    border-radius: 8px 8px 0 0;
}

.user-menu a:last-child {
    border-radius: 0 0 8px 8px;
}

/* User profile button in nav */
.nav [onclick*="toggleUserMenu"] {
    position: relative;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav [onclick*="toggleUserMenu"]:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Form groups */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.form-input {
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-accent {
    background: var(--accent);
    color: white;
}

.btn-accent:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(14, 165, 233, 0.3);
}

.btn-accent:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-cream);
    border-color: var(--primary);
}

/* Messages */
.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid #ef4444;
}

.success-message {
    background: #dcfce7;
    color: #166534;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid #10b981;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .auth-tab {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .user-menu {
        right: -1rem;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}