/* ================================================= */
/* BASE GENERAL                                     */
/* ================================================= */

body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background: #0f2744;
    color: #f5f5f5;
}

/* ================================================= */
/* ================== MODO TV ====================== */
/* ================================================= */
/* Se activa automáticamente cuando NO es móvil
   porque tu PHP solo imprime layout-horizontal
   en versión sala */

.layout-horizontal {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* ---------- PANEL IZQUIERDO (FOTO) ---------- */

.left-panel {
    width: 50%;
    height: 100vh;
    background: linear-gradient(
        180deg,
        #0d2340 0%,
        #0b1d34 50%,
        #071524 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: inset -15px 0 40px rgba(0,0,0,0.4);
}

.left-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 520px;
}

.logo-horizontal {
    width: 160px;
    margin-bottom: 30px;
}

.memorial-photo {
    max-height: 55vh;
    border-radius: 12px;
    box-shadow: 0 30px 70px rgba(0,0,0,0.6);
    margin-bottom: 30px;
}

.memorial-info {
    text-align: center;
    max-width: 650px;
}

.memorial-info h2 {
    font-size: 28px;
    margin-bottom: 10px;
}

.memorial-info .dates {
    font-size: 16px;
    color: #c7d7ea;
    margin-bottom: 15px;
}

.quote {
    font-size: 14px;
    font-style: italic;
    opacity: 0.8;
}
/* =========================
   LOMO DEL LIBRO (TV)
========================= */

/* Línea dorada divisoria */
.left-panel::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 70px;
    height: 100%;
    background: linear-gradient(
        180deg,
        #081a30 0%,
        #061424 100%
    );
    box-shadow: inset -8px 0 15px rgba(0,0,0,0.6);
}
.left-panel::after {
    content: "";
    position: absolute;
    left: 68px;
    top: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(197,169,74,0.8),
        rgba(197,169,74,0.3)
    );
}

.book-spine-title {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: rotate(-90deg) translateY(-50%);
    transform-origin: left center;
    font-family: 'Cormorant Garamond', serif;
    letter-spacing: 4px;
    font-size: 18px;
    color: rgba(255,255,255,0.25);
    pointer-events: none;
}

/* ---------- PANEL DERECHO (LIBRO) ---------- */

.right-panel {
    width: 50%;
    height: 100vh;
    background: #eef1f5;
    padding: 70px 80px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Contenedor de lista */
#comments {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 10px;
}

.book-header h1 {
    font-size: 42px;
    color: #0f2744;
    margin-bottom: 30px;
}

.book-header p {
    font-size: 16px;
    color: #5f6b7a;
    max-width: 520px;
}

/* Comentarios TV */

.comments-section {
    width: 100%;
}

.comment-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.comment-text {
    flex: 1;
}

.comment-photos {
    display: flex;
    gap: 8px;
}

.photo-avatar {
    width: 55px;
    height: 55px;
    object-fit:fill;
    border-radius: 2%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.comment-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 32px 36px;
    box-shadow: 
        0 8px 25px rgba(0,0,0,0.06);
    transition: transform 0.3s ease;
    margin-bottom: 5px;
}

/* Efecto muy leve al rotar */
.qr-container p {
    font-size: 14px;
    color: #7a7a7a;
    margin-top: 6px;
}
/* Comillas decorativas */

.comment-card::before {
    content: "“";
    font-size: 60px;
    position: absolute;
    top: 20px;
    left: 25px;
    color: rgba(0,0,0,0.06);
}

.comment-card::after {
    content: "”";
    font-size: 60px;
    position: absolute;
    bottom: 20px;
    right: 25px;
    color: rgba(0,0,0,0.06);
}

.comment-message {
    font-size: 17px;
    font-style: italic;
    color: #222;
    line-height: 1.6;
    margin-bottom: 18px;
}

.comment-name {
    font-size: 17px;
    font-weight: 600;
    color: #000;
}

/* Fecha */
.comment-date {
    font-size: 13px;
    color: #7a7a7a;
    margin-top: 4px;
}

/* QR TV */
.comment-photos {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.photo-bubble {
    width: 16px;
    height: 16px;
    background: #c5a94a;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.qr-horizontal {
    width: 100px;
    align-self: flex-end;
}

/* ================================================= */
/* ================== MODO MÓVIL =================== */
/* ================================================= */

@media (max-width: 768px) {

    body {
        background:
            linear-gradient(90deg, rgba(255,255,255,0.03) 0px, transparent 80px),
            radial-gradient(circle at center,
                #1f3a5f 0%,
                #142a44 50%,
                #0c1b2e 80%,
                #08121f 100%
            );
        text-align: center;
        min-height: 100vh;
    }

    /* Oculta layout TV */
    .layout-horizontal {
        display: none;
    }

    /* Header móvil */
    .header {
        padding: 20px 0;
    }

    .logo {
        width: 120px;
        opacity: 0.95;
    }

    .hero {
        margin-top: 20px;
    }

    .photo {
        width: 240px;
        border-radius: 14px;
        box-shadow: 0 25px 60px rgba(0,0,0,0.7);
    }

    h2 {
        font-size: 24px;
        margin-top: 20px;
    }

    .dates {
        font-size: 14px;
        color: #9fb4cc;
        margin-bottom: 20px;
    }

    h1 {
        font-size: 26px;
        margin-top: 20px;
    }

    .subtitle {
        font-size: 12px;
        color: #c7d7ea;
        font-style: italic;
        margin-bottom: 30px;
    }

    /* Formulario móvil */

    .form-section {
        margin: 30px auto;
        width: 90%;
    }

    .form-section input,
    .form-section textarea {
        width: 100%;
        padding: 15px;
        margin-bottom: 15px;
        border-radius: 8px;
        border: none;
        font-size: 16px;
    }

    .form-section button {
        width: 100%;
        padding: 15px;
        background: #c5a94a;
        color: #000;
        font-weight: bold;
        border: none;
        border-radius: 8px;
        cursor: pointer;
    }

    /* Oculta comentarios en móvil */
    .comments-section {
        display: none;
    }

    .qr-horizontal {
        display: none;
    }
}

/* ================================================= */
/* MODAL DE AGRADECIMIENTO (AMBOS MODOS)            */
/* ================================================= */

.thankyou-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.thankyou-box {
    background: #ffffff;
    padding: 40px 60px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0,0,0,0.4);
}

.thankyou-box h3 {
    color: #000;
    margin-bottom: 10px;
}

.thankyou-box p {
    color: #444;
}

/* =============================
   LOADING OVERLAY
============================= */

.loading-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
}

.loading-box {
    background: #ffffff;
    padding: 35px 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0,0,0,0.4);
}

.loading-box h3 {
    color: #000;
    margin-bottom: 15px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ddd;
    border-top: 4px solid #c5a94a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* =============================
   PROGRESS BAR
============================= */

.progress-section {
    margin-top: 30px;
    text-align: center;
}

.progress-section h3 {
    margin-bottom: 15px;
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background: #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: #c5a94a;
    transition: width 0.2s ease;
}