/* Import Google Fonts - Tipografías mejoradas para mejor legibilidad */
@import url('https://fonts.googleapis.com/css2?family=Noto+Color+Emoji&family=Lora:ital,wght@0,400;0,500;0,600;1,400&family=Open+Sans:wght@400;600;700&display=swap');

/* Estilos de la Novena */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Root variables para control de tamaño de fuente */
:root {
    --base-font-size: 16px;
    --heading-font: 'Lora', 'Georgia', serif;
    --body-font: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

.novenario-plugin-container {
    font-family: var(--body-font);
    /* background: linear-gradient(135deg, #1a472a 0%, #2d5a3d 100%); */
    /* Removed body background to not affect whole site, or apply to container */
    color: #2c2c2c;
    /* min-height: 100vh; */
    padding: 20px;
    width: 100%;
    font-size: var(--base-font-size);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Clases para control de tamaño de fuente */
.novenario-plugin-container.font-small {
    --base-font-size: 14px;
}

.novenario-plugin-container.font-normal {
    --base-font-size: 16px;
}

.novenario-plugin-container.font-large {
    --base-font-size: 18px;
}

.novenario-plugin-container.font-xlarge {
    --base-font-size: 20px;
}

.novenario-container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    width: 100%;
}

.novenario-container header {
    background: linear-gradient(135deg, #c41e3a 0%, #8b0000 100%);
    color: white;
    padding: 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.novenario-header-content h1 {
    font-family: var(--heading-font);
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    color: white;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.novenario-header-content p {
    font-size: 1.2em;
    opacity: 0.95;
    color: white;
    font-weight: 400;
}

/* Controles de tamaño de fuente */
.novenario-font-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.font-control-label {
    font-size: 0.9em;
    font-weight: 600;
    margin-right: 5px;
    color: white;
}

.font-size-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 8px 14px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
    transition: all 0.3s ease;
    min-width: 45px;
    font-family: var(--body-font);
}

.font-size-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.font-size-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.font-size-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.novenario-tabs {
    display: flex;
    flex-wrap: wrap;
    background: #f8f8f8;
    border-bottom: 3px solid #c41e3a;
    overflow-x: auto;
}

.novenario-tab-button {
    flex: 1;
    min-width: 120px;
    padding: 15px 10px;
    background: #e8e8e8;
    border: none;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: bold;
    color: #333;
    transition: all 0.3s;
    border-right: 1px solid #ccc;
}

.novenario-tab-button:hover {
    background: #d0d0d0;
}

.novenario-tab-button.active {
    background: #c41e3a;
    color: white;
}

.novenario-tab-content {
    display: none;
    padding: 40px;
    animation: fadeIn 0.5s;
}

.novenario-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.novenario-day-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #c41e3a;
}

.novenario-day-header h2 {
    font-family: var(--heading-font);
    font-size: 2em;
    color: #c41e3a;
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.novenario-day-header h3 {
    font-family: var(--heading-font);
    font-size: 1.5em;
    color: #2d5a3d;
    margin-bottom: 12px;
    font-weight: 500;
}

.novenario-day-header p {
    font-size: 1.1em;
    color: #555;
    font-style: italic;
    line-height: 1.6;
}

.novenario-day-pdf-btn {
    display: inline-block;
    background: linear-gradient(135deg, #2d5a3d 0%, #1a472a 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
    margin: 15px 0 10px 0;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
    font-family: 'Georgia', serif, 'Noto Color Emoji';
}

.novenario-day-pdf-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #3a7050 0%, #2d5a3d 100%);
}

.novenario-day-pdf-btn:active {
    transform: translateY(0);
}

.novenario-prayer-section {
    margin-bottom: 30px;
    padding: 25px;
    background: #fafafa;
    border-left: 5px solid #c41e3a;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.novenario-prayer-section h4 {
    font-family: var(--heading-font);
    font-size: 1.3em;
    color: #c41e3a;
    margin-bottom: 18px;
    font-weight: 600;
}

.novenario-prayer-section h5 {
    font-family: var(--heading-font);
    font-weight: 500;
}

.novenario-prayer-section p {
    line-height: 1.9;
    color: #3a3a3a;
    text-align: justify;
    font-size: 1em;
    margin-bottom: 12px;
}

.novenario-order-list {
    background: #fffbf0;
    padding: 25px;
    border-radius: 10px;
    margin: 25px 0;
    border: 2px solid #f0e5d0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.novenario-order-list h4 {
    font-family: var(--heading-font);
    color: #2d5a3d;
    margin-bottom: 18px;
    font-size: 1.2em;
    font-weight: 600;
}

.novenario-order-list ol {
    margin-left: 25px;
}

.novenario-order-list li {
    margin: 12px 0;
    line-height: 1.8;
    font-size: 1em;
    color: #3a3a3a;
}

.novenario-audio-container {
    margin: 15px 0;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 8px;
    border: 2px solid #c41e3a;
}

.novenario-audio-container audio {
    width: 100%;
    outline: none;
}

.novenario-footer {
    text-align: center;
    padding: 20px;
    background: #2d5a3d;
    color: white;
}

/* Pantallas grandes (desktops) */
@media (min-width: 1200px) {
    .novenario-plugin-container {
        padding: 40px;
    }

    .novenario-tab-content {
        padding: 50px;
    }
}

/* Tablets y pantallas medianas */
@media (max-width: 1024px) {
    .novenario-container {
        max-width: 95%;
    }

    .novenario-container header h1 {
        font-size: 2em;
    }

    .novenario-container header p {
        font-size: 1.1em;
    }

    .novenario-day-header h2 {
        font-size: 1.8em;
    }

    .novenario-day-header h3 {
        font-size: 1.3em;
    }

    .novenario-tab-content {
        padding: 30px;
    }
}

/* Tablets pequeñas */
@media (max-width: 768px) {
    .novenario-plugin-container {
        padding: 15px;
    }

    .novenario-container header {
        padding: 20px;
    }

    .novenario-header-content h1 {
        font-size: 1.6em;
    }

    .novenario-header-content p {
        font-size: 1em;
    }

    .novenario-font-controls {
        padding: 8px;
        gap: 8px;
    }

    .font-control-label {
        font-size: 0.85em;
    }

    .font-size-btn {
        padding: 6px 10px;
        font-size: 0.9em;
        min-width: 40px;
    }

    .novenario-tab-button {
        min-width: 80px;
        padding: 12px 8px;
        font-size: 0.8em;
    }

    .novenario-tab-content {
        padding: 20px;
    }

    .novenario-day-header h2 {
        font-size: 1.4em;
    }

    .novenario-day-header h3 {
        font-size: 1.2em;
    }

    .novenario-day-header p {
        font-size: 0.95em;
    }

    .novenario-day-pdf-btn {
        font-size: 0.85em;
        padding: 7px 14px;
    }

    .novenario-prayer-section {
        padding: 15px;
        margin-bottom: 20px;
    }

    .novenario-prayer-section h4 {
        font-size: 1.1em;
    }

    .novenario-prayer-section p {
        font-size: 0.95em;
        line-height: 1.6;
    }

    .novenario-order-list {
        padding: 15px;
    }

    .novenario-order-list h4 {
        font-size: 1.1em;
    }

    .novenario-order-list li {
        font-size: 0.95em;
    }

    .novenario-footer {
        padding: 15px;
        font-size: 0.9em;
    }
}

/* Móviles */
@media (max-width: 480px) {
    .novenario-plugin-container {
        padding: 10px;
    }

    .novenario-container {
        border-radius: 10px;
    }

    .novenario-container header {
        padding: 15px;
        gap: 10px;
    }

    .novenario-header-content h1 {
        font-size: 1.3em;
        margin-bottom: 5px;
    }

    .novenario-header-content p {
        font-size: 0.9em;
    }

    .novenario-font-controls {
        flex-wrap: wrap;
        padding: 8px;
        gap: 6px;
    }

    .font-control-label {
        font-size: 0.8em;
        width: 100%;
        text-align: center;
        margin-bottom: 5px;
    }

    .font-size-btn {
        padding: 6px 12px;
        font-size: 0.85em;
        min-width: 35px;
        flex: 1;
    }

    .novenario-tab-button {
        min-width: 70px;
        padding: 10px 5px;
        font-size: 0.7em;
        line-height: 1.3;
    }

    .novenario-tab-content {
        padding: 15px;
    }

    .novenario-day-header {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    .novenario-day-header h2 {
        font-size: 1.2em;
        margin-bottom: 8px;
    }

    .novenario-day-header h3 {
        font-size: 1em;
        margin-bottom: 8px;
    }

    .novenario-day-header p {
        font-size: 0.85em;
    }

    .novenario-day-pdf-btn {
        font-size: 0.8em;
        padding: 6px 12px;
        margin: 10px 0 8px 0;
    }

    .novenario-day-header img {
        margin-top: 10px;
    }

    .novenario-prayer-section {
        padding: 12px;
        margin-bottom: 15px;
    }

    .novenario-prayer-section h4 {
        font-size: 1em;
        margin-bottom: 10px;
    }

    .novenario-prayer-section h5 {
        font-size: 0.9em;
    }

    .novenario-prayer-section p {
        font-size: 0.85em;
        line-height: 1.5;
        text-align: left;
    }

    .novenario-order-list {
        padding: 12px;
        margin: 15px 0;
    }

    .novenario-order-list h4 {
        font-size: 1em;
        margin-bottom: 10px;
    }

    .novenario-order-list ol {
        margin-left: 15px;
    }

    .novenario-order-list li {
        font-size: 0.85em;
        margin: 8px 0;
    }

    .novenario-audio-container {
        padding: 10px;
        margin: 10px 0;
    }

    .novenario-footer {
        padding: 12px;
        font-size: 0.8em;
    }

    .novenario-footer p {
        margin: 5px 0;
    }
}

.novenario-pdf-download-btn {
    display: inline-block;
    background: linear-gradient(135deg, #c41e3a 0%, #8b0000 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    margin-bottom: 20px;
    cursor: pointer;
    border: none;
    font-size: 1em;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
    font-family: 'Georgia', serif, 'Noto Color Emoji';
}

.novenario-pdf-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.novenario-pdf-download-btn:active {
    transform: translateY(0);
}

.novenario-pdf-download-btn::before {
    content: "ðŸ“„ ";
    margin-right: 8px;
}

@media (max-width: 768px) {
    .novenario-pdf-download-btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }
}

/* Estilos para impresiÃ³n/PDF - Optimizado */
@media print {
    @page {
        margin: 1.5cm;
        size: auto;
    }

    body {
        background: white;
        padding: 0;
        margin: 0;
    }

    .novenario-container {
        box-shadow: none;
        border-radius: 0;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Ocultar header principal, pestaÃ±as, botones y footer */
    .novenario-container>header,
    .novenario-tabs,
    .novenario-pdf-download-btn,
    .novenario-audio-container,
    .novenario-footer {
        display: none !important;
    }

    /* Ocultar TODOS los contenidos de pestaÃ±a por defecto */
    .novenario-tab-content {
        display: none !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        animation: none !important;
    }

    /* Mostrar SOLO el contenido de la pestaÃ±a activa */
    .novenario-tab-content.active {
        display: block !important;
    }

    /* Compactar secciones */
    .novenario-day-header,
    .novenario-prayer-section,
    .novenario-order-list {
        page-break-inside: avoid;
        border: none !important;
        padding: 10px 0 !important;
        margin-bottom: 15px !important;
        background: transparent !important;
    }

    .novenario-prayer-section h4 {
        color: #c41e3a;
        margin-top: 0;
        margin-bottom: 5px;
    }

    .novenario-day-header h2 {
        margin-top: 0;
        font-size: 1.8em;
    }

    p,
    li {
        font-size: 11pt;
        line-height: 1.4;
    }

    img {
        max-width: 60% !important;
        height: auto;
        display: block;
        margin: 10px auto;
        page-break-inside: avoid;
    }
}
