/* Authentication UI Styles */

/* Modal Styles */
.auth-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.auth-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.auth-modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 400px;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

.auth-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    transition: color 0.2s ease;
}

.auth-modal-close:hover {
    color: #333;
}

/* Auth Form Styles */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-form h2 {
    text-align: center;
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.form-group input {
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-group input.error {
    border-color: #f44336;
}

.form-error {
    color: #f44336;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.form-success {
    color: #4caf50;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Auth Buttons */
.auth-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
    display: inline-block;
}

.auth-btn-primary {
    background-color: #2196F3;
    color: white;
}

.auth-btn-primary:hover {
    background-color: #1976D2;
    transform: translateY(-1px);
}

.auth-btn-secondary {
    background-color: transparent;
    color: #2196F3;
    border: 2px solid #2196F3;
}

.auth-btn-secondary:hover {
    background-color: #2196F3;
    color: white;
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Navigation Auth Elements */
.nav-auth {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Auth UI Initial State - prevent flashing */
#auth-buttons, #user-menu {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#auth-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#auth-buttons .auth-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
}

#user-menu {
    display: none;
    position: relative;
}

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.user-dropdown:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #2196F3;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
}

.user-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    min-width: 180px;
    z-index: 100;
}

.user-dropdown:hover .user-dropdown-content {
    display: block;
}

.user-dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 0.9rem;
}

.user-dropdown-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Auth Switch */
.auth-switch {
    text-align: center;
    margin-top: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.auth-switch a {
    color: #2196F3;
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Password Reset */
.forgot-password {
    text-align: center;
    margin-top: 0.5rem;
}

.forgot-password a {
    color: #2196F3;
    text-decoration: none;
    font-size: 0.85rem;
}

.forgot-password a:hover {
    text-decoration: underline;
}

/* Loading States */
.auth-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

/* Admin Badge */
.admin-badge {
    background-color: #ff9800;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 0.5rem;
}

/* Admin Only Elements */
.admin-only {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-modal-content {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    #auth-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    #auth-buttons .auth-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .auth-modal-content {
        background-color: #2d2d2d;
        color: white;
    }
    
    .form-group input {
        background-color: #3d3d3d;
        border-color: #555;
        color: white;
    }
    
    .form-group input:focus {
        border-color: #2196F3;
    }
    
    .user-dropdown-content {
        background-color: #2d2d2d;
        color: white;
    }
}