/**
 * auth.css - Authentication UI Styles for BLACK BOX ANIMATOR
 *
 * Theme: Purple/Magenta with Black/Charcoal
 * Font: Montserrat (brand), Space Mono (UI)
 *
 * Components:
 * - Sign-in button
 * - User profile dropdown
 * - Email preferences modal
 */

/* ============================================
   AUTH CONTAINER (Header Integration)
   ============================================ */

.auth-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

/* ============================================
   SIGN-IN BUTTON
   ============================================ */

.auth-button.signin-button {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    color: #e0e0e0;
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-button.signin-button:hover {
    background: #333;
    border-color: #ff00ff;
    box-shadow: 0 0 8px rgba(255, 0, 255, 0.3);
}

/* ============================================
   USER PROFILE (Header Display)
   ============================================ */

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.user-profile:hover {
    background: rgba(255, 0, 255, 0.1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #ff00ff;
    box-shadow: 0 0 8px rgba(255, 0, 255, 0.5);
}

.user-name {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    color: #e0e0e0;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-button {
    background: none;
    border: none;
    color: #999;
    font-size: 10px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.user-menu-button:hover {
    color: #ff00ff;
}

/* ============================================
   USER DROPDOWN MENU
   ============================================ */

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    min-width: 240px;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #222;
}

.dropdown-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #ff00ff;
    box-shadow: 0 0 8px rgba(255, 0, 255, 0.5);
}

.dropdown-user-info {
    flex: 1;
    overflow: hidden;
}

.dropdown-user-name {
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    font-weight: bold;
    color: #e0e0e0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-user-email {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

.user-dropdown-divider {
    height: 1px;
    background: #444;
    margin: 4px 0;
}

.dropdown-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: #e0e0e0;
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-menu-item:hover {
    background: rgba(255, 0, 255, 0.1);
}

.dropdown-menu-item.logout {
    color: #ff6b6b;
}

.dropdown-menu-item.logout:hover {
    background: rgba(255, 107, 107, 0.1);
}

/* ============================================
   EMAIL PREFERENCES MODAL
   ============================================ */

.email-prefs-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.email-prefs-overlay.visible {
    opacity: 1;
}

.email-prefs-modal {
    display: flex;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    background: #1a1a1a;
    border: 2px solid #ff00ff;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.5);
    overflow: hidden;
}

/* ============================================
   MODAL LEFT SIDE (Branding)
   ============================================ */

.email-prefs-left {
    flex: 0 0 300px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border-right: 1px solid #444;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.email-prefs-branding {
    margin-bottom: 30px;
}

.brand-main {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 32px;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.brand-product {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 28px;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: #ff00ff;
    text-shadow: 0 0 12px rgba(255, 0, 255, 0.8),
                 0 2px 4px rgba(0, 0, 0, 0.5);
    margin-top: 4px;
}

.email-prefs-description {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #999;
}

/* ============================================
   MODAL RIGHT SIDE (Form)
   ============================================ */

.email-prefs-right {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

.email-prefs-right h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 24px;
    color: #ffffff;
    margin: 0 0 8px 0;
}

.email-prefs-subtitle {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    color: #999;
    margin: 0 0 30px 0;
}

.email-prefs-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ============================================
   EMAIL PREFERENCE ITEMS
   ============================================ */

.email-pref-group {
    position: relative;
}

.email-pref-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.email-pref-label:hover {
    background: #333;
    border-color: #ff00ff;
}

.email-pref-label.required {
    opacity: 0.7;
    cursor: not-allowed;
}

.email-pref-label.required:hover {
    background: #2a2a2a;
    border-color: #444;
}

/* Custom checkbox */
.email-pref-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-custom {
    position: relative;
    width: 20px;
    height: 20px;
    min-width: 20px;
    background: #1a1a1a;
    border: 2px solid #666;
    border-radius: 3px;
    transition: all 0.2s;
}

.email-pref-checkbox:checked + .checkbox-custom {
    background: #ff00ff;
    border-color: #ff00ff;
    box-shadow: 0 0 8px rgba(255, 0, 255, 0.5);
}

.email-pref-checkbox:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
}

.email-pref-checkbox:disabled + .checkbox-custom {
    background: #444;
    border-color: #666;
    cursor: not-allowed;
}

.email-pref-content {
    flex: 1;
}

.email-pref-title {
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    font-weight: bold;
    color: #e0e0e0;
    margin-bottom: 4px;
}

.email-pref-description {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #999;
}

/* ============================================
   FREQUENCY SELECTOR
   ============================================ */

.email-frequency-group {
    padding: 20px 16px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    margin-top: 8px;
}

.email-frequency-label {
    display: block;
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    font-weight: bold;
    color: #e0e0e0;
    margin-bottom: 12px;
}

.email-frequency-options {
    display: flex;
    gap: 20px;
}

.frequency-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.frequency-option input[type="radio"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #666;
    border-radius: 50%;
    background: #1a1a1a;
    cursor: pointer;
    transition: all 0.2s;
}

.frequency-option input[type="radio"]:checked {
    border-color: #ff00ff;
    background: #ff00ff;
    box-shadow: 0 0 8px rgba(255, 0, 255, 0.5);
}

.frequency-option input[type="radio"]:checked::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: #ffffff;
    border-radius: 50%;
    position: relative;
    top: 3px;
    left: 3px;
}

.frequency-option span {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    color: #e0e0e0;
}

/* ============================================
   MODAL ACTIONS
   ============================================ */

.email-prefs-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.email-prefs-button {
    flex: 1;
    padding: 14px 24px;
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.email-prefs-button.primary {
    background: #ff00ff;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(255, 0, 255, 0.5);
}

.email-prefs-button.primary:hover {
    background: #ff33ff;
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.8);
    transform: translateY(-1px);
}

.email-prefs-button.primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.email-prefs-button.secondary {
    background: transparent;
    color: #999;
    border: 1px solid #444;
}

.email-prefs-button.secondary:hover {
    color: #e0e0e0;
    border-color: #666;
    background: rgba(255, 255, 255, 0.05);
}

.email-prefs-footer {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #666;
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .email-prefs-modal {
        flex-direction: column;
        width: 95%;
        max-height: 90vh;
    }

    .email-prefs-left {
        flex: 0 0 auto;
        padding: 20px;
    }

    .brand-main {
        font-size: 24px;
    }

    .brand-product {
        font-size: 20px;
    }

    .email-prefs-right {
        padding: 20px;
    }

    .email-frequency-options {
        flex-direction: column;
        gap: 12px;
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

.email-prefs-right::-webkit-scrollbar {
    width: 8px;
}

.email-prefs-right::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.email-prefs-right::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.email-prefs-right::-webkit-scrollbar-thumb:hover {
    background: #ff00ff;
}
