:root {
    --primary-color: #7c3aed;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #555;
    --border-color: #f3f4f6;
    --accent-red: #ef4444;
    --hover-bg: #f9fafb;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Overlay que bloquea el contenido mientras se verifica la sesión */
#auth-overlay {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}
#auth-overlay .auth-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e0e0e0;
    border-top-color: #5229f1;
    border-radius: 50%;
    animation: auth-spin 0.8s linear infinite;
}
#auth-overlay p {
    color: #555;
    font-size: 15px;
    font-family: sans-serif;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* Estado usuario en navbar */
#auth-user-info {
    display: none;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 14px;
}
#auth-user-info .auth-username {
    font-weight: 600;
}
#auth-user-info .auth-counter {
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 12px;
}
#auth-logout-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    border-radius: 6px;
    padding: 5px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}
#auth-logout-btn:hover {
    background: rgba(255,255,255,0.3);
}
#auth-login-btn {
    background: #fff;
    color: var(--primary-color);
    border: none;
    border-radius: 6px;
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
#auth-login-btn:hover {
    opacity: 0.85;
}

.shadcn-nav-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Inter', sans-serif;
    position: relative;
}

.shadcn-badge {
    background: #7c3aed;
    color: white;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.shadcn-user-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.shadcn-user-trigger:hover { background: #f1f5f9; }

.shadcn-avatar {
    width: 28px;
    height: 28px;
    background: #475569;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.shadcn-email-label {
    font-size: 14px;
    color: #1e293b;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shadcn-chevron { font-size: 10px; color: #64748b; }

.shadcn-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    padding: 6px;
    display: none;
    z-index: 1000;
}

.shadcn-menu.show { display: block; }

.shadcn-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-size: 14px;
    color: #334155;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
}

.shadcn-menu-item:hover { background: #f1f5f9; }
.shadcn-menu-item.logout { color: #e11d48; }
.shadcn-divider { height: 1px; background: #e2e8f0; margin: 4px 0; }

@media only screen and (max-width: 991px) {

    .shadcn-nav-wrapper {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        padding: 15px 20px;
        gap: 15px;
        border-top: 1px solid #26237a;
        margin-top: 10px;
    }

    .shadcn-badge {
        width: 100%;
        justify-content: center;
        padding: 10px 15px;
    }

    .shadcn-user-trigger {
        width: 100%;
        border: none;
        background: transparent;
        padding: 10px 4px;
    }

    .shadcn-user-trigger:hover {
        background: #2a2685;
        border: 1px solid #2a2685;
    }

    .shadcn-email-label {
        color: #fff;
    }

    .shadcn-menu {
        position: relative;
        top: 0;
        right: 0;
        width: 100%;
        box-shadow: none;
        border: none;
        background: #f8fafc;
        padding: 0 0 0 20px;
        margin-top: -4px;
        display: none;
    }

    .shadcn-menu.show {
        display: block;
        background: #141330;
    }

    .shadcn-menu-item {
        padding: 12px 0;
        border-radius: 0;
        background: transparent !important;
        color: #fff;
    }

    .shadcn-menu-item svg {
        stroke: currentColor;
        transition: stroke 0.2s ease;
    }

    .shadcn-divider {
        background: #26237a;
    }
}

.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
    transition: background 0.3s ease-out;
    pointer-events: none;
}

.auth-modal-overlay.active {
    background: rgba(0, 0, 0, 0.4);
    pointer-events: auto;
}

.auth-modal-card {
    background: white;
    padding: 2.5rem;
    border-radius: 22px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-modal-overlay.active .auth-modal-card {
    opacity: 1;
    transform: scale(1);
}

.auth-modal-card h2 {
    color: #4b5563;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.auth-modal-card p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.auth-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-modal {
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-modal-cancel {
    background: #f3f4f6;
    color: var(--text-muted);
}

.btn-modal-cancel:hover { background: #e5e7eb; }

.btn-modal-confirm {
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);;
}

.btn-modal-confirm:hover { background: #6730c8; }

.ribbon {
    position: absolute;
    top: -7px;
    right: -32px;
    transform: rotate(43deg);
    background-color: #DC2626;
    color: white;
    font-size: 9px;
    font-weight: 800;
    padding: 3px 25px;
    text-align: center;
    align-content: end;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100px;
    height: 48px;
}
