/**
 * Estilos para el Sistema de Autenticación con Google
 * @version 2.1.0
 */

/* ======================
   USER SECTION - Header
   ====================== */

.user-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    flex: 1;
    justify-content: flex-end;
    margin-right: 12px;
}

/* Indicador de Sincronización */
.sync-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.sync-indicator.syncing {
    background: var(--color-warning, #ff9500);
    color: white;
}

.sync-indicator.syncing .sync-icon {
    animation: syncPulse 1.5s infinite;
}

.sync-indicator.error {
    background: var(--color-error, #ff3b30);
    color: white;
}

@keyframes syncPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

.sync-icon {
    font-size: 14px;
}

.sync-text {
    font-size: 11px;
    font-weight: 500;
}

/* Perfil de Usuario */
.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 4px 4px;
    background: var(--bg-secondary);
    border-radius: 24px;
    transition: all 0.3s ease;
}

.user-profile:hover {
    background: var(--bg-tertiary, var(--bg-secondary));
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-primary, #00ff41);
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-logout-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-logout-btn:hover {
    background: var(--bg-tertiary, rgba(255, 255, 255, 0.1));
    color: var(--color-error, #ff3b30);
    transform: translateX(2px);
}

/* Botón de Login de Google */
.google-login-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.google-login-btn:hover {
    background: #f8f9fa;
    border-color: #c6c6c6;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.google-login-btn:active {
    background: #f1f3f4;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transform: translateY(1px);
}

.google-login-btn svg {
    width: 18px;
    height: 18px;
}

.google-login-btn span {
    font-size: 13px;
}

/* ======================
   LOCKED OVERLAY
   ====================== */

.locked-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.locked-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.lock-message {
    text-align: center;
    padding: 40px 30px;
    background: var(--bg-secondary);
    border-radius: 20px;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: lockFadeIn 0.4s ease;
}

@keyframes lockFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.lock-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: lockBounce 2s ease infinite;
}

@keyframes lockBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.lock-message h3 {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.lock-message p {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.5;
    margin: 0 0 24px 0;
}

/* Botón de Login Grande (en overlay) */
.google-login-btn-large {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    background: white;
    color: #3c4043;
    border: none;
    border-radius: 28px;
    font-size: 16px;
    font-weight: 500;
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.google-login-btn-large:hover {
    background: #f8f9fa;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.google-login-btn-large:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.google-login-btn-large svg {
    width: 20px;
    height: 20px;
}

.google-login-btn-large span {
    font-size: 15px;
}

/* ======================
   TEMA CLARO
   ====================== */

[data-theme="light"] .google-login-btn {
    background: white;
    color: #3c4043;
    border-color: #dadce0;
}

[data-theme="light"] .google-login-btn:hover {
    background: #f8f9fa;
    border-color: #c6c6c6;
}

[data-theme="light"] .locked-overlay {
    background: rgba(255, 255, 255, 0.92);
}

[data-theme="light"] .lock-message {
    background: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

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

@media (max-width: 768px) {
    .user-section {
        gap: 8px;
        padding: 0 8px;
        margin-right: 8px;
    }

    .user-name {
        max-width: 80px;
        font-size: 12px;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
    }

    .google-login-btn span {
        display: none;
    }

    .google-login-btn {
        padding: 8px 12px;
    }

    .lock-message {
        padding: 30px 20px;
        max-width: 320px;
    }

    .lock-message h3 {
        font-size: 20px;
    }

    .lock-message p {
        font-size: 14px;
    }

    .google-login-btn-large {
        padding: 12px 24px;
        font-size: 15px;
    }

    .google-login-btn-large span {
        font-size: 14px;
    }
}

/* ======================
   ANIMACIONES
   ====================== */

.user-profile,
.sync-indicator,
.google-login-btn {
    animation: fadeInSlide 0.3s ease;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Estados de carga */
.google-login-btn.loading,
.google-login-btn-large.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.google-login-btn.loading::after,
.google-login-btn-large.loading::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid #3c4043;
    border-top-color: transparent;
    border-radius: 50%;
    display: inline-block;
    margin-left: 8px;
    animation: spinner 0.8s linear infinite;
}

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

/* ======================
   BOTONES BLOQUEADOS PREMIUM
   ====================== */

.locked-premium {
    opacity: 0.6;
    cursor: pointer !important;
    position: relative;
    background: var(--bg-secondary) !important;
    border: 2px dashed var(--color-warning, #ff9500) !important;
}

.locked-premium:hover {
    opacity: 0.8;
    background: var(--bg-tertiary, var(--bg-secondary)) !important;
    transform: scale(1.02);
}

.locked-premium .lock-icon-btn {
    margin-right: 6px;
    font-size: 14px;
    animation: lockShake 2s infinite;
}

@keyframes lockShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}
