/**
 * Authentication UI Styles
 * Add this CSS to pages that need auth functionality
 */

/* Auth Buttons Container */
#auth-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Auth Sign-in Button - Matches site btn-secondary style */
.btn-auth-signin {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background: transparent;
    color: white;
    border: 2px solid white;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    font-size: 0.95rem;
}

.btn-auth-signin:hover {
    background: white;
    color: #1e3c72;
    transform: translateY(-2px);
}

/* User Menu */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.1);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
}

.user-menu:hover {
    background: rgba(255,255,255,0.2);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid white;
}

.user-name {
    color: white;
    font-weight: 500;
    font-size: 0.95rem;
}

/* User Dropdown Menu */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 1000;
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: #2c3e50;
    text-decoration: none;
    transition: background 0.2s;
    font-weight: 500;
}

.user-dropdown a:first-child {
    border-radius: 8px 8px 0 0;
}

.user-dropdown a:last-child {
    border-radius: 0 0 8px 8px;
}

.user-dropdown a:hover {
    background: #f8f9fa;
}

/* Admin-only elements */
.admin-only {
    display: none;
}

/* Global Message */
#global-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-weight: 500;
    z-index: 10000;
    max-width: 400px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.message-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Loading Spinner */
.auth-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Protected Page Overlay */
.auth-required-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.auth-required-content {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
}

.auth-required-content h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.auth-required-content p {
    margin-bottom: 2rem;
    color: #7f8c8d;
}

/* Responsive */
@media (max-width: 768px) {
    .user-name {
        display: none;
    }

    .user-menu {
        padding: 0.5rem;
    }

    #global-message {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .auth-required-content {
        margin: 1rem;
        padding: 2rem 1.5rem;
    }
}
