/* ============================================
   Web de Boda: Jessica & Miguel
   Tema: Elegante, cálido, tonos pastel
   ============================================ */

/* --- Tipografía --- */
body {
    font-family: 'Raleway', sans-serif;
    color: #4a4a4a;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
}

.justified {
    text-align: justify;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;
    overflow-wrap: break-word;
}

/* --- Contenido Markdown (subsecciones de texto) --- */
.markdown-content p {
    margin-bottom: 1rem;
}
.markdown-content ul,
.markdown-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}
.markdown-content li {
    margin-bottom: 0.3rem;
}
.markdown-content strong {
    font-weight: 700;
    color: #5a3a2a;
}
.markdown-content em {
    font-style: italic;
}
.markdown-content h1 { font-size: 1.8rem; margin: 1.5rem 0 0.75rem; }
.markdown-content h2 { font-size: 1.5rem; margin: 1.25rem 0 0.5rem; }
.markdown-content h3 { font-size: 1.25rem; margin: 1rem 0 0.5rem; }
.markdown-content h4 { font-size: 1.1rem; margin: 0.75rem 0 0.5rem; }
.markdown-content a {
    color: #d4a574;
    text-decoration: underline;
}
.markdown-content a:hover {
    color: #c9966b;
}
.markdown-content hr {
    border: none;
    border-top: 1px solid #e0d5c5;
    margin: 1.5rem 0;
}
.markdown-content blockquote {
    border-left: 3px solid #d4a574;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #8B8B5C;
    font-style: italic;
}
.markdown-content code {
    background: #f5efe6;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}
.markdown-content pre {
    background: #f5efe6;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1rem;
}
.markdown-content pre code {
    background: none;
    padding: 0;
}

/* ============================================
   Timeline / Itinerario — minimal tipográfico
   ============================================ */

.timeline {
    position: relative;
    padding-left: 3.5rem;
}

/* Cada hito */
.timeline-item {
    position: relative;
    padding-bottom: 2.5rem;
}
.timeline-item:last-child {
    padding-bottom: 0;
}

/* Línea vertical: tramo superior (desde el borde superior hasta el dot) */
.timeline-item::before {
    content: '';
    position: absolute;
    left: -3.06rem;
    top: 0;
    width: 1px;
    height: 0.85rem;
    background: #e0d5c5;
}
.timeline-item:first-child::before {
    display: none;
}

/* Línea vertical: tramo inferior (desde el dot hasta el borde inferior) */
.timeline-item::after {
    content: '';
    position: absolute;
    left: -3.06rem;
    top: 0.85rem;
    bottom: 0;
    width: 1px;
    background: #e0d5c5;
}
.timeline-item:last-child::after {
    display: none;
}

/* Círculo sobre la línea */
.timeline-dot {
    position: absolute;
    left: -3.06rem;
    top: 0.45rem;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #d4a574;
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.15);
    transform: translateX(-50%);
    z-index: 1;
}

/* Hora */
.timeline-time {
    display: inline;
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    color: #6B3A2A;
    line-height: 1;
}
.timeline-time::after {
    content: ' \2014\ ';
    color: #d4a574;
}

/* Título */
.timeline-title {
    display: inline;
    font-family: 'Raleway', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #4a4a4a;
    margin: 0;
    line-height: 1.35;
}

/* Descripción */
.timeline-desc {
    color: #999;
    font-size: 0.9rem;
    line-height: 1.65;
    margin: 0;
}

@media (max-width: 576px) {
    .timeline {
        padding-left: 2rem;
    }
    .timeline-item::before {
        left: -1.69rem;
        height: 0.81rem;
    }
    .timeline-item::after {
        left: -1.69rem;
        top: 0.81rem;
    }
    .timeline-dot {
        left: -1.69rem;
        width: 10px;
        height: 10px;
        top: 0.5rem;
    }
    .timeline-time {
        display: block;
        font-size: 1.2rem;
    }
    .timeline-time::after {
        content: none;
    }
    .timeline-title {
        display: block;
        font-size: 1rem;
    }
    .timeline-item {
        padding-bottom: 2rem;
    }
}

/* --- Navbar --- */
.wedding-brand {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: #8B4513 !important;
}
.wedding-brand i {
    color: #d4a574;
}

/* --- Botón principal --- */
.btn-wedding {
    background: linear-gradient(135deg, #d4a574, #c9966b);
    border: none;
    color: white;
    padding: 0.6rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s;
}
.btn-wedding:hover {
    background: linear-gradient(135deg, #c9966b, #b8865a);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 165, 116, 0.4);
}
.btn-outline-wedding {
    border: 2px solid #d4a574;
    color: #8B4513;
    background: transparent;
}
.btn-outline-wedding:hover {
    background: #d4a574;
    color: white;
}

/* --- Hero --- */
.hero-section {
    background: linear-gradient(135deg, #fdf6f0 0%, #f5e6d3 50%, #e8d5c4 100%);
    min-height: 80vh;
    position: relative;
    overflow: hidden;
}
.hero-subtitle {
    font-size: 1.2rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #c9966b;
    margin-bottom: 0.5rem;
}
.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 4rem;
    color: #6B3A2A;
    margin-bottom: 1rem;
}
.hero-date {
    font-size: 1.3rem;
    color: #8B8B5C;
    font-weight: 300;
}
.scroll-down {
    animation: bounce 2s infinite;
    color: #d4a574;
    font-size: 1.5rem;
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

/* --- Secciones --- */
.section-title {
    font-family: 'Playfair Display', serif;
    color: #6B3A2A;
    font-size: 2.5rem;
    position: relative;
    padding-bottom: 1rem;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #d4a574;
}

/* --- Cards --- */
.info-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}
.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.event-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    border-left: 4px solid #d4a574;
}
.event-day {
    display: block;
    font-size: 2.5rem;
    font-family: 'Playfair Display', serif;
    color: #6B3A2A;
    line-height: 1;
}
.event-month {
    display: block;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #8B8B5C;
    letter-spacing: 2px;
}

.dresscode-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.05);
}

/* --- Paleta de colores --- */
.color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* --- Footer --- */
.footer {
    border-top: 1px solid #f0e8d8;
}

/* --- Galería de imágenes --- */
.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.gallery-grid-centered {
    justify-content: center;
}

.gallery-item {
    flex: 0 1 auto;
    max-width: 350px;
    min-width: 150px;
}

.gallery-item .card {
    width: fit-content;
}

/* En móvil, una imagen por fila */
@media (max-width: 576px) {
    .gallery-item {
        max-width: 100%;
        flex: 1 1 100%;
        display: flex;
        justify-content: center;
    }
}

.gallery-img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 250px;
    cursor: pointer;
    transition: opacity 0.2s;
    border-top-left-radius: calc(0.375rem - 1px);
    border-top-right-radius: calc(0.375rem - 1px);
}

.gallery-img:hover {
    opacity: 0.85;
}

/* --- Responsive --- */

/* Imagen de novios: responsiva por defecto */
.novios-img {
    max-width: 100%;
    height: auto;
    width: 300px;
}

/* Tablet / móvil grande */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    .hero-subtitle {
        font-size: 1rem;
    }
    .section-title {
        font-size: 2rem;
    }
    .novios-img {
        width: 250px;
    }
}

/* Móvil estándar — 576px */
@media (max-width: 576px) {
    /* Escala global de fuente: afecta a todo el contenido incluido Bootstrap */
    html {
        font-size: 17px;
    }

    /* Hero */
    .hero-section {
        min-height: 60vh;
    }
    .hero-title {
        font-size: 2.2rem;
    }
    .hero-subtitle {
        font-size: 0.95rem;
        letter-spacing: 3px;
    }
    .hero-date {
        font-size: 1.1rem;
    }

    /* Secciones: menos padding vertical para no malgastar pantalla */
    .container.py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    .section-title {
        font-size: 1.8rem;
    }

    /* Imagen novios */
    .novios-img {
        width: 220px;
    }

    /* Cards */
    .info-card {
        padding: 1rem !important;
    }
    .dresscode-card {
        padding: 1.5rem !important;
    }

    /* Color swatches */
    .color-swatch {
        width: 32px;
        height: 32px;
    }

    /* ========================================
       Targets táctiles — mínimo 48px
       ======================================== */
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="password"],
    select,
    textarea,
    .form-control,
    .form-select {
        min-height: 48px;
        font-size: 16px; /* Evita zoom automático en iOS al hacer foco */
    }

    .btn,
    .btn-wedding {
        min-height: 48px;
        padding: 0.75rem 2rem;
    }

    .btn-wedding.btn-lg {
        padding: 0.85rem 2.5rem;
    }

    .form-check-input {
        width: 1.3em;
        height: 1.3em;
        margin-top: 0.15em;
    }

    .form-check-label {
        padding-left: 0.25rem;
        line-height: 1.6;
    }

    /* Radios y checks en columna en vez de inline para más área de toque */
    .form-check-inline {
        display: block;
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
}

/* Móvil muy pequeño — 400px (iPhone SE, etc.) */
@media (max-width: 400px) {
    .hero-title {
        font-size: 1.8rem;
    }
    .hero-subtitle {
        font-size: 0.85rem;
        letter-spacing: 2px;
    }
    .hero-date {
        font-size: 1rem;
    }
    .section-title {
        font-size: 1.5rem;
    }
    .novios-img {
        width: 180px;
    }

    /* Navbar: nombre más compacto */
    .wedding-brand {
        font-size: 1.1rem;
    }
}

/* ============================================
   Admin — Responsive
   ============================================ */

/* Tabletas y móviles: compactar tablas del admin y apilar botones de acción */
@media (max-width: 768px) {
    /* Botones de acción en columna en vez de fila */
    .admin-actions {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
        align-items: stretch;
    }
    .admin-actions .btn {
        width: 100%;
        white-space: nowrap;
        justify-content: center;
        display: flex;
        align-items: center;
    }

    /* Reducir padding en tablas para ganar espacio */
    .table td,
    .table th {
        padding: 0.5rem 0.4rem;
    }

    /* Los inputs de formulario en celdas: ancho completo */
    td .form-control,
    td .form-select {
        min-width: 0;
        width: 100%;
    }

    /* Header de página admin: título y botón apilados */
    .admin-page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem;
    }
}

/* Móvil: ocultar columnas secundarias, compactar aún más */
@media (max-width: 576px) {
    /* Ocultar columna "Mensaje" (preview) en tabla de mensajes */
    .col-mensaje-preview {
        display: none;
    }

    /* Ocultar columna "Fecha Confirmación" en RSVP (ya está en el badge) */
    .col-fecha-confirmacion {
        display: none;
    }

    /* Acciones en tabla: más compactas aún */
    .admin-actions .btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
    }

    /* Cards del dashboard: 2 por fila ya con col-6, ok */
    /* Formularios en row: col-md-* ya stackea, ok */

    /* Inputs de orden en tablas: más pequeños */
    td input[type="number"].form-control-sm {
        width: 55px !important;
        min-width: 55px;
    }
}

/* ============================================
   Autocomplete / Sugerencias RSVP
   ============================================ */

.sugerencias-list {
    border: 1px solid #d4a574;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    background: #fff;
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
}

.sugerencias-list .list-group-item {
    border-left: none;
    border-right: none;
    cursor: pointer;
    padding: 0.6rem 1rem;
    transition: background 0.15s;
}

.sugerencias-list .list-group-item:first-child {
    border-top: none;
}

.sugerencias-list .list-group-item:hover,
.sugerencias-list .list-group-item.active-suggestion {
    background-color: #fdf6f0;
    color: #6B3A2A;
    font-weight: 500;
}

.sugerencias-list .list-group-item .suggestion-categoria {
    font-size: 0.8rem;
    color: #8B8B5C;
    margin-left: 0.4rem;
}

/* ============================================
   RSVP — Bloques de asistentes
   ============================================ */

.asistente-block {
    background: #fdfaf6;
    border: 1px solid #e8d5c4;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s;
}

.asistente-block:hover {
    border-color: #d4a574;
}

.asistente-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.asistente-block-header .asistente-nombre {
    font-weight: 600;
    color: #6B3A2A;
    font-size: 0.95rem;
}

.asistente-block-header .asistente-etiqueta {
    font-size: 0.7rem;
    color: #8B8B5C;
    background: #f5e6d3;
    border-radius: 20px;
    padding: 0.15rem 0.6rem;
    margin-left: 0.5rem;
}

.asistente-block .btn-remove-asistente {
    background: none;
    border: none;
    color: #c9966b;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 0.3rem;
    line-height: 1;
    transition: color 0.15s;
}

.asistente-block .btn-remove-asistente:hover {
    color: #b85c5c;
}

.asistente-block .opciones-rsvp {
    padding-top: 0.5rem;
    border-top: 1px dashed #e8d5c4;
}

.asistente-block .opciones-rsvp .opciones-titulo {
    font-size: 0.8rem;
    color: #8B8B5C;
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   RSVP — Email en bloque de asistente
   ============================================ */

.asistente-email {
    padding-top: 0.4rem;
    margin-bottom: 0.4rem;
}

/* ============================================
   Impresión / Informes PDF
   ============================================ */

@media print {
    /* Ocultar navbar, botones, acciones, filtros */
    nav,
    .navbar,
    .admin-actions,
    .btn,
    .admin-page-header .btn,
    .filter-bar,
    .search-bar,
    .pagination,
    .nav-tabs,
    .tab-content > .tab-pane:not(.active),
    .no-print {
        display: none !important;
    }

    /* Resetear estilos de bootstrap para impresión */
    body {
        font-family: 'Georgia', 'Times New Roman', serif !important;
        font-size: 11pt;
        color: #000;
        background: #fff;
        padding: 0;
        margin: 0;
    }

    .container,
    .container-fluid {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .card {
        border: none !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }

    .card-body {
        padding: 0.5rem 0 !important;
    }

    /* Tablas: compactas y legibles */
    .table {
        width: 100%;
        border-collapse: collapse;
        font-size: 9pt;
        margin-bottom: 1rem;
    }

    .table th,
    .table td {
        padding: 4px 6px;
        border: 1px solid #ccc;
        text-align: left;
        vertical-align: top;
    }

    .table th {
        background-color: #eee !important;
        color: #000 !important;
        font-weight: bold;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        page-break-inside: avoid;
    }

    .table tbody tr {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .table-striped tbody tr:nth-child(odd) {
        background-color: #f9f9f9 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Badges: colores visibles en impresión */
    .badge {
        border: 1px solid #999;
        background: #eee !important;
        color: #000 !important;
        font-weight: normal;
        padding: 1px 5px;
        font-size: 8pt;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .badge.bg-success { background: #d4edda !important; border-color: #28a745; }
    .badge.bg-danger  { background: #f8d7da !important; border-color: #dc3545; }
    .badge.bg-warning { background: #fff3cd !important; border-color: #ffc107; }
    .badge.bg-primary { background: #cce5ff !important; border-color: #007bff; }
    .badge.bg-info    { background: #d1ecf1 !important; border-color: #17a2b8; }
    .badge.bg-secondary { background: #e2e3e5 !important; border-color: #6c757d; }

    /* Progress bars */
    .progress {
        border: 1px solid #ccc;
        background: #eee;
        height: 14px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .progress-bar {
        background: #999 !important;
        color: #000 !important;
        font-size: 8pt;
        text-align: center;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Títulos */
    h1, h2, h3, h4 {
        font-family: 'Georgia', 'Times New Roman', serif !important;
        color: #000;
    }

    h2 { font-size: 16pt; margin-bottom: 0.5rem; border-bottom: 2px solid #000; padding-bottom: 0.25rem; }
    h3 { font-size: 13pt; margin-bottom: 0.3rem; }
    h4 { font-size: 11pt; margin-bottom: 0.2rem; }

    /* Encabezado y pie de página */
    .print-header {
        text-align: center;
        margin-bottom: 1.5rem;
        padding-bottom: 0.5rem;
        border-bottom: 3px double #000;
    }

    .print-header h1 {
        font-size: 20pt;
        margin: 0 0 0.25rem;
        border: none;
    }

    .print-header .subtitle {
        font-size: 11pt;
        color: #555;
    }

    .print-footer {
        text-align: center;
        font-size: 8pt;
        color: #999;
        margin-top: 1.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid #ccc;
    }

    /* Ajustes para el layout de informe */
    .report-container {
        max-width: 100%;
        padding: 0 1cm;
    }

    .report-section {
        margin-bottom: 1.5rem;
        page-break-inside: avoid;
    }

    .report-section h3 {
        background: #eee;
        padding: 4px 8px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .report-summary-row {
        display: flex;
        justify-content: space-between;
        padding: 3px 0;
        border-bottom: 1px dotted #ccc;
    }

    .report-total-row {
        font-weight: bold;
        border-top: 2px solid #000;
        padding-top: 4px;
        margin-top: 4px;
    }

    /* Índice de informes: ocultar tarjetas no esenciales */
    .report-index-card {
        page-break-inside: avoid;
    }

    /* Saltos de página forzados */
    .page-break { page-break-before: always; }

    /* Evitar saltos dentro de elementos */
    tbody tr {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    .report-section {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* Ocultar enlaces href expandidos */
    a[href]:after { content: none !important; }
}

/* Vista previa en pantalla: simular cómo se vería al imprimir */
@media screen {
    .report-container {
        font-size: 12px;
    }

    /* Eliminar scroll horizontal de tablas responsivas */
    .report-container .table-responsive {
        overflow: visible !important;
        display: block !important;
        width: 100% !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: auto !important;
    }

    .report-container .table {
        font-size: 11px;
        margin-bottom: 1rem;
        table-layout: auto;
        width: 100%;
        display: table;
    }

    .report-container .table th,
    .report-container .table td {
        padding: 5px 6px;
        border: 1px solid #ddd;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
    }

    .report-container .table th {
        background-color: #f0f0f0;
        font-weight: bold;
    }

    .report-container .table tbody tr {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .report-container .table-striped tbody tr:nth-child(odd) {
        background-color: #fafafa;
    }

    .report-container h1,
    .report-container h2,
    .report-container h3 {
        font-family: 'Georgia', 'Times New Roman', serif;
    }

    .report-container h2 {
        font-size: 16px;
        border-bottom: 1px solid #ccc;
        padding-bottom: 0.5rem;
        margin: 1rem 0 0.5rem;
    }

    .report-container h3 {
        font-size: 13px;
        margin: 0.5rem 0 0.3rem;
    }

    /* Badges compactos en pantalla */
    .report-container .badge {
        font-size: 10px;
        padding: 2px 6px;
    }

    /* Progress bars más delgadas */
    .report-container .progress {
        height: 12px;
        font-size: 9px;
    }

    /* Textos de resumen compactos */
    .report-container .report-summary-row {
        font-size: 10px;
        padding: 3px 0;
    }
}
