/* ========================================
   Himnario Digital — Canto View
   Modern Design v2.0
   ======================================== */

.canto-bg {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 30% 10%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 90%, rgba(167, 139, 250, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, #0f0e17 0%, #1a1830 50%, #0f0e17 100%);
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 1rem;
    overflow-y: auto;
}

.canto-overlay {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    animation: cantoFadeIn 0.5s ease-out;
}

.canto-card {
    background: var(--bg-card, rgba(255,255,255,0.06));
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: var(--radius, 16px);
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ---- Header ---- */
.canto-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.75rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(167, 139, 250, 0.1));
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.1));
}

.canto-numero {
    font-size: 1rem;
    font-weight: 800;
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.12);
    padding: 0.3rem 0.9rem;
    border-radius: 50px;
    border: 1px solid rgba(245, 158, 11, 0.25);
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.canto-himnario {
    font-size: 0.85rem;
    color: var(--text-secondary, #94a3b8);
    font-weight: 500;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    word-break: normal;
    min-width: 0;
}

/* ---- Body ---- */
.canto-body {
    padding: 2rem 1.75rem;
    min-height: 200px;
}

.canto-body p {
    color: var(--text, #e2e8f0);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 1.25rem;
    text-align: center;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    word-break: normal;
}

.canto-body p:last-child {
    margin-bottom: 0;
}

/* ---- Footer / Actions ---- */
.canto-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem 1.75rem;
    border-top: 1px solid var(--border, rgba(255,255,255,0.1));
    background: rgba(0, 0, 0, 0.15);
}

.btn-canto-salir,
.btn-canto-print {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.btn-canto-salir {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light, #818cf8);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.btn-canto-salir:hover {
    background: rgba(99, 102, 241, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.2);
}

.btn-canto-print {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary, #94a3b8);
    border: 1px solid var(--border, rgba(255,255,255,0.1));
}

.btn-canto-print:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text, #e2e8f0);
    transform: translateY(-1px);
}

/* ---- Error State ---- */
.canto-body .canto-error {
    text-align: center;
    padding: 2rem 0;
}

.canto-body .canto-error p {
    color: var(--text-muted, #64748b);
    font-size: 0.95rem;
}

/* ---- Animation ---- */
@keyframes cantoFadeIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .canto-bg { padding: 1rem 0.75rem; padding-top: 2rem; }
    .canto-header { padding: 1rem 1.25rem; flex-direction: column; gap: 0.5rem; text-align: center; }
    .canto-body { padding: 1.5rem 1.25rem; }
    .canto-body p { font-size: 0.95rem; line-height: 1.7; }
    .canto-footer { padding: 1rem 1.25rem; flex-direction: column; }
    .btn-canto-salir, .btn-canto-print { width: 100%; justify-content: center; }
}

/* ---- Print ---- */
@media print {
    .canto-bg {
        background: white !important;
        padding: 0;
        align-items: flex-start;
        min-height: auto !important;
        overflow: visible !important;
        display: block !important;
    }
    .canto-overlay {
        max-width: 100% !important;
        animation: none !important;
    }

    .canto-card {
        background: white !important;
        border: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        border-radius: 0 !important;
        overflow: visible !important;
    }

    .canto-header {
        background: none !important;
        border-bottom: 2px solid #333 !important;
        padding: 0.5rem 0 !important;
    }

    .canto-numero {
        color: #111 !important;
        background: none !important;
        border: none !important;
        padding: 0 !important;
    }

    .canto-himnario {
        color: #555 !important;
    }

    .canto-body {
        padding: 1rem 0 !important;
    }

    .canto-body p {
        color: #111 !important;
        font-size: 12pt;
        line-height: 1.6;
    }

    .canto-footer {
        display: none !important;
    }

    body {
        background: white !important;
        color: #111 !important;
    }

    /* Marca de agua - leyenda central */
    .canto-card::before {
        content: 'Himnario Digital Chimborazo';
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) rotate(-35deg);
        font-size: 3.5rem;
        font-weight: 800;
        color: rgba(99, 102, 241, 0.06);
        white-space: nowrap;
        pointer-events: none;
        z-index: 0;
    }

    /* Pie de impresión con datos de contacto */
    .canto-card::after {
        content: 'himnario.multiserviciosjp.com  •  Tel: 098 682 9407 / 096 138 5933  •  WhatsApp: 099 621 2999';
        display: block;
        text-align: center;
        font-size: 8pt;
        color: #999;
        border-top: 1px solid #ddd;
        padding-top: 0.5rem;
        margin-top: 1rem;
        letter-spacing: 0.5px;
    }
}
