/* ── ORATIOVOX INTERACTIVE COMPONENTS ─────────────────────── */

/* 1. Player (Bottom Sheet) */
.player-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none; /* Hidden by default */
    align-items: flex-end;
}

.player-overlay:not([style*="display: none"]) {
    display: flex;
}

/* Alpine Transitions */
.transition { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.ease-out { transition-timing-function: cubic-bezier(0, 0, 0.2, 1); }
.ease-in { transition-timing-function: cubic-bezier(0.4, 0, 1, 1); }
.duration-300 { transition-duration: 300ms; }
.opacity-0 { opacity: 0; }
.opacity-100 { opacity: 1; }
.translate-y-full { transform: translateY(100%); }
.translate-y-0 { transform: translateY(0); }

.player-box {
    background: var(--bg-card);
    border-radius: 32px 32px 0 0;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    height: 94vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow-lg);
    will-change: transform;
    overflow: hidden;
}

.player-header {
    padding: 0 24px;
    flex-shrink: 0;
}

.player-handle {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 12px auto 15px;
    flex-shrink: 0;
    cursor: grab;
}

.player-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--gold-glow);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
}

.player-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 24px;
}

.player-text-container {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 10px;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
}

.player-footer {
    flex-shrink: 0;
    background: var(--bg-card);
    padding: 20px 24px calc(20px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    z-index: 20;
    box-shadow: var(--shadow-md);
}

.player-text {
    display: block !important;
    width: 100%;
    text-align: center;
    font-style: normal;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.8;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal !important;
}

.player-line {
    margin: 0 0 12px 0;
    min-height: 1.2em;
}

.word-highlight {
    background: var(--gold-glow);
    color: var(--gold);
    border-radius: 4px;
    padding: 0 4px;
    font-weight: 700;
}

.word-spent { opacity: 0.5; }

.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 15px;
}

.ctrl-play {
    width: 60px;
    height: 60px;
    background: var(--gold);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
}

.ctrl-skip {
    background: transparent;
    border: none;
    color: var(--gold);
    font-size: 24px;
    cursor: pointer;
}

.player-secondary-btn {
    background: none;
    border: none;
    color: var(--gold);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0.8;
    transition: all 0.2s;
}

.speed-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.speed-btn {
    background: rgba(0,0,0,0.03);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    min-width: 70px;
}

.speed-btn.active {
    background: var(--gold);
    color: #fff;
    border-color: var(--gold);
}

/* 2. Calendário */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-top: 10px;
}

.calendar-weekday {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-secondary);
    text-align: center;
    padding-bottom: 5px;
    font-weight: 700;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 12px;
    background: rgba(0,0,0,0.03);
    color: #ccc;
    position: relative;
    border: 1px solid transparent;
}

.calendar-day.current-month {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text-primary);
}

.calendar-day.is-today {
    border-color: var(--gold);
    font-weight: 700;
    box-shadow: inset 0 0 0 1px var(--gold);
}

.calendar-day.has-prayer {
    background: var(--gold-glow);
    border-color: var(--gold);
}

.prayer-dot { font-size: 8px; margin-top: 1px; }

/* 3. Notificações (Toasts) */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 250px;
    max-width: 350px;
    padding: 15px 20px;
    border-radius: 12px;
    background: var(--bg-card);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
    border-left: 4px solid var(--gold);
    animation: toastSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-success { border-left-color: #10b981; }
.toast-error { border-left-color: #ef4444; }

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 600px) {
    .toast-container { top: 10px; right: 10px; left: 10px; }
    .toast { min-width: 0; width: 100%; }
}

/* 4. Modais */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.modal-overlay:not([style*="display: none"]) {
    display: flex;
}

.modal-box {
    background: var(--bg-card);
    border-radius: 20px;
    width: 100%;
    max-width: 380px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

/* 5. Loading & Skeletons */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(2px);
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 20000;
}

.loading-overlay:not([style*="display: none"]) {
    display: flex;
}

@media (prefers-color-scheme: dark) {
    .loading-overlay { background: rgba(0,0,0,0.7); }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gold-glow);
    border-left-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
    background: var(--border);
    opacity: 0.6;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

@media (prefers-color-scheme: dark) {
    .skeleton { background: rgba(255,255,255,0.05); opacity: 1; }
}

.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer { 100% { transform: translateX(100%); } }

.skeleton-card { height: 100px; width: 100%; margin-bottom: 15px; }

/* 6. Navegação Mobile */
.bottom-nav { display: none; }

@media (max-width: 768px) {
    .tabs-wrap { display: none !important; }
    
    .bottom-nav {
        position: fixed;
        bottom: 0; left: 0; right: 0;
        display: flex;
        background: var(--bg-card);
        border-top: 1px solid var(--border);
        padding-bottom: env(safe-area-inset-bottom);
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    }
    
    .bottom-nav-item {
        flex: 1;
        text-align: center;
        padding: 10px 4px 8px;
        font-size: 10px;
        font-weight: 600;
        color: var(--text-secondary);
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        border: none;
        background: none;
        cursor: pointer;
    }
    
    .bottom-nav-item.active { color: var(--gold); }
    .bottom-nav-item svg { width: 22px; height: 22px; }
    .content { padding-bottom: 80px; }
}

/* 7. Miscelânea */
.verse-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 30px 25px;
    border-radius: 20px;
    margin-bottom: 35px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px var(--gold-glow);
}

.verse-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.dark-mode .verse-card {
    background: linear-gradient(135deg, #1c1b19 0%, #121110 100%);
}
