/* Reseteo universal de márgenes y paddings */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* -------------------------------------- */
/* DECLARACIÓN DE TIPOGRAFÍAS */
/* -------------------------------------- */

/* 1. Tipografía PRINCIPAL (Against Regular) para títulos */
@font-face {
    font-family: "Against Regular"; 
    /* Asegúrate de que las rutas y los nombres de archivo coincidan */
    src: url('fonts/against-regular.woff') format('woff'), 
            url('fonts/against-regular.woff2') format('woff2'); 
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* 2. Tipografía para NOTAS (Ink Free) */
@font-face {
    font-family: "Ink Free"; 
    /* Asegúrate de que las rutas y los nombres de archivo coincidan */
    src: url('fonts/InkFree.woff') format('woff'); 
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
/* -------------------------------------- */

@font-face {
    font-family: 'Against Regular';
    src: url('fonts/Against Regular.ttf') format('truetype'), /* EJEMPLO */
         url('fonts/Against Regular.woff') format('woff');    /* EJEMPLO */
    font-weight: normal;
    font-style: normal;
}


body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #ffffff; 
    color: #000000; 
    line-height: 1.6;
}

.banner {
    position: relative;
    background-image: url('boda.jpg');
    background-size: cover;
    background-position: center;
    padding: 150px 20px; 
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0);
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
}

.main-title-section {
    background-color: #ffffff;
    padding: 20px 20px 0 20px; 
    text-align: center;
    margin-bottom: 0; 
    border-bottom: 1px solid #e0e0e0; 
}

.main-title-section h1 {
    /* H1 PRINCIPAL: Usa Against Regular */
    font-family: "Against Regular"; 
    font-size: 2.8em;
    color: #f4c456; 
}

.qr-image {
    width: 250px; 
    height: 250px;
    object-fit: contain; 
    margin-top: 20px; 
    margin-bottom: 10px; 
    border-radius: 8px; 
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: white; 
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); 
}

/* NUEVO CONTENEDOR DE QR */
.qr-download-section {
    width: 90%;
    max-width: 1200px;
    margin: 0px auto; 
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}
/* FIN NUEVO CONTENEDOR DE QR */


h2 {
    /* H2 SUBTÍTULOS: Usa Against Regular */
    font-family: "Against Regular"; 
    color: #2d4b89; 
    margin-top: 30px;
    border-bottom: 1px solid #e0e0e0; 
    padding-bottom: 10px;
    text-align: center;
}


/* LÍNEA 40 - 50 (o donde terminen tus estilos generales) */
/* --- INICIO: NUEVOS ESTILOS H3 --- */
h3 {
    font-family: 'Against Regular', sans-serif; /* Aplica la tipografía */
    color: #2d4b89; /* Color negro */
    font-size: 1.5em; /* Tamaño sugerido, puedes ajustarlo */
    margin-top: 20px;
    margin-bottom: 10px;
    text-align: center; /* Se recomienda centrarlo para coherencia con h2 */
}

/* -------------------------------------- */
/* Estilos para las Pestañas Horizontales */
/* -------------------------------------- */
.tab-container {
    padding: 0;
    margin-top: 20px;
    margin-bottom: 20px;
}

.tab-header-bar {
    display: flex; 
    justify-content: center; 
    margin-bottom: 0;
    border-bottom: 2px solid #e0e0e0; 
    overflow-x: auto; 
    white-space: nowrap; 
}

.tab-header {
    /* MODIFICACIÓN: Esto hace que las dos pestañas ocupen el mismo ancho y se centren */
    flex-grow: 1; 
    text-align: center;
    cursor: pointer;
    padding: 10px 15px;
    font-size: 1.05em;
    font-weight: 600;
    color: #555;
    border: none;
    border-bottom: 3px solid transparent; 
    background: transparent;
    transition: all 0.3s ease;
}

.tab-header:hover {
    color: #333;
    border-bottom: 3px solid #ccc;
}

.tab-header.active {
    color: #403458; 
    border-bottom: 3px solid #f4c456;
    background-color: #fff;
}

.tab-content-wrapper {
    padding: 20px 0 0 0;
}

.tab-content {
    display: none; 
    animation: fadeIn 0.5s;
}

.tab-content.active {
    display: block; 
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
/* -------------------------------------- */


/* Estilos para formularios de subida y notas */
#uploadForm, #noteForm { 
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
    padding: 15px;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
}
#noteForm {
    border-radius: 8px; 
}

#uploadForm button, #noteForm button { 
    padding: 12px 20px;
    background-color: #f4c456; 
    color: white;
    border: none;
    border-radius: 25px; 
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}
#uploadForm button:hover, #noteForm button:hover { 
    background-color: #1a1a1a; 
}

#noteText, #noteName, #uploaderName { 
    width: calc(100% - 20px); 
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 15px; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1em;
    resize: vertical; 
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1); 
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
#noteText:focus, #noteName:focus, #uploaderName:focus { 
    border-color: #333333;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1), 0 0 8px rgba(51, 51, 51, 0.2);
    outline: none;
}

/* Estilos para las opciones de color */
.color-options {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
    margin-bottom: 10px;
}
.color-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}
.color-option input[type="radio"] {
    display: none; 
}
.color-box {
    width: 30px;
    height: 30px;
    border-radius: 50%; 
    border: 2px solid #ccc;
    transition: border-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.color-option input[type="radio"]:checked + .color-box {
    border-color: #333333; 
    transform: scale(1.15); 
    box-shadow: 0 2px 6px rgba(51, 51, 51, 0.4);
}
/* Definición de colores */
.color-box.lightpink { background-color: #FFB6C1; } 
.color-box.lightgreen { background-color: #90EE90; } 
.color-box.black { background-color: #000000; } 
.color-box.lightblue { background-color: #ADD8E6; } 

.upload-area {
    width: 100%;
    border: 2px dashed #000000; 
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin-bottom: 10px;
    min-height: 150px;
}

.upload-area:hover {
    background-color: #f0f0f0; 
}

.upload-label {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.upload-label img {
    max-width: 100px;
    max-height: 100px;
    display: block; 
    margin: auto;
}

#fileInput { 
    display: none;
}

#file-name-display { 
    font-size: 0.9em;
    color: #555;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
hr {
    border: 1px solid #e0e0e0;
    margin: 20px 0;
}


/* Estilos para la previsualización de IMAGEN */
#image-preview, #note-preview-section { 
    margin-top: 20px;
    text-align: center;
    border: 1px dashed #ccc;
    padding: 15px;
    border-radius: 5px;
    min-height: 100px; 
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column; 
}
#image-preview img {
    max-width: 70%;
    height: auto;
    display: block;
    margin: 10px auto;
    border-radius: 5px;
}
#image-preview .uploader-name-preview { 
    font-size: 0.9em;
    color: #555;
    margin-top: 5px;
    font-style: italic; 
}

#message { 
    margin-top: 20px;
    text-align: center;
    font-weight: bold;
}

/* AJUSTE: Aplicamos el grid a las galerías restantes */
#gallery, #note-gallery { 
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 30px;
}
.gallery-image-item { 
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out;
    background-color: #ffffff;
    padding-bottom: 5px;
}
.gallery-image-item:hover { 
    transform: scale(1.03);
}

.gallery-image-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0;
    cursor: pointer;
}
.gallery-image-item .uploader-name { 
    font-size: 0.85em;
    color: #555;
    font-style: italic;
    padding: 0 10px;
    word-wrap: break-word;
    text-align: center;
}


/* -------------------------------------- */
/* ESTILOS DE NOTA CON FUENTE INK FREE */
/* -------------------------------------- */
#note-preview-section {
    margin-top: 20px;
    text-align: center;
    border: 1px dashed #ccc; 
    padding: 15px;
    border-radius: 5px;
    min-height: 120px; 
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column; 
}
#note-preview-section .note-preview { 
    padding: 15px;
    border-radius: 8px;
    min-height: 100px; 
    display: flex;
    flex-direction: column; 
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #000000; /* Color de texto por defecto */
    word-wrap: break-word; 
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); 
    transition: background-color 0.3s ease, color 0.3s ease; 
    
    /* Aplicación de Ink Free */
    font-family: "Ink Free", cursive; 
    font-size: 1.3em; 
    line-height: 1.3;
    /* Fin Aplicación de Ink Free */

    width: 100%; 
    box-sizing: border-box; 
}
#note-preview-section .note-preview .note-preview-text {
    margin-top: 5px;
    word-break: break-word;
}
#note-preview-section .note-preview .note-preview-name {
    font-size: 0.9em;
    opacity: 0.8;
    margin-bottom: 5px;
}
.note-preview.lightpink { background-color: #FFB6C1; }
.note-preview.lightgreen { background-color: #90EE90; }
.note-preview.black { background-color: #000000; color: #fff; } /* CORRECCIÓN: Texto blanco para fondo negro */
.note-preview.lightblue { background-color: #ADD8E6; }
/* -------------------------------------- */


/* ESTILOS DE NOTA EN GALERÍA CON FUENTE INK FREE */
.note-item {
    padding: 15px;
    border-radius: 8px;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.1em;
    color: #000000; /* Color de texto por defecto */
    word-wrap: break-word; 
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out;
    
    /* Aplicación de Ink Free */
    font-family: "Ink Free", cursive;
    font-size: 1.3em;
    line-height: 1.3;
    /* Fin Aplicación de Ink Free */
}
.note-item:hover {
    transform: scale(1.03);
}
.note-item .note-text {
    margin-top: 5px;
    word-break: break-word;
}
.note-item .note-name {
    font-size: 0.9em;
    opacity: 0.8;
    margin-bottom: 5px;
}

.note-item.lightpink { background-color: #FFB6C1; }
.note-item.lightgreen { background-color: #90EE90; }
.note-item.black { background-color: #000000; color: #fff; } /* CORRECCIÓN: Texto blanco para fondo negro */
.note-item.lightblue { background-color: #ADD8E6; }
/* -------------------------------------- */

/* Estilos del Lightbox */
#lightbox { 
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    cursor: pointer;
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    user-select: none;
    z-index: 1001;
}

.close-lightbox:hover,
.close-lightbox:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

#lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    position: relative;
    z-index: 999;
}


/* Estilos del Modal de Copyright */
.copyright-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
}
.copyright-modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 400px;
    text-align: center;
    border-radius: 8px;
}
.copyright-modal-content h3 {
    color: #000000; 
}
.copyright-modal-content button {
    background-color: #333333; 
    color: white;
    border: none;
    padding: 10px 20px;
    margin-top: 15px;
    cursor: pointer;
    border-radius: 25px;
}
.copyright-modal-content button:hover {
    background-color: #1a1a1a;
}

/* -------------------------------------- */
/* ESTILOS DE BOTONES DE DESCARGA DE QR (Pequeños y en línea) */
/* -------------------------------------- */
.download-buttons {
    text-align: center;
    margin: 0px 0; 
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.download-text {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
}

.download-button {
    display: inline-block;
    padding: 8px 15px; 
    background-color: #2d4b89;
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em; 
    transition: background-color 0.3s ease, transform 0.1s;
    min-width: 80px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.download-button:hover {
    background-color: #1a1a1a;
    transform: translateY(-1px);
}
/* -------------------------------------- */

/* Estilos del footer */
.footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background-color: #ffffff;
    margin-top: 40px;
    border-top: 1px solid #e0e0e0;
}
.logo-container {
    margin-bottom: 10px;
}
.logo-container img {
    max-width: 150px;
    height: auto;
}
.social-icons {
    margin-top: 10px;
    display: flex;
    gap: 15px;
}
.social-icons a img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    transition: transform 0.3s ease-in-out;
}
.social-icons a:hover img {
    transform: scale(1.15);
}

.download-container {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 20px;
}

#downloadButton { 
    padding: 12px 20px;
    background-color: #f4c456;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}
#downloadButton:hover { 
    background-color: #1a1a1a;
}

/* -------------------------------------- */
/* Estilos para el Botón Flotante de Música */
/* -------------------------------------- */

/* NUEVO: Contenedor Flotante para el botón y la leyenda */
.music-control-container {
    position: fixed;
    bottom: 25px; 
    right: 25px;
    display: flex; 
    flex-direction: column; /* Apilar la etiqueta encima del botón */
    align-items: center;
    z-index: 900; 
}

/* NUEVO: Estilo para la Leyenda de Música */
.music-label {
    margin-bottom: 5px; /* Espacio entre la etiqueta y el botón */
    padding: 3px 8px;
    background-color: rgba(45 75 137); /* Usar el color del botón */
    color: white;
    font-size: 0.85em;
    font-weight: bold;
    border-radius: 10px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease;
}
.music-control-container:hover .music-label {
    background-color: rgba(45 75 137); /* Fondo oscuro al pasar el ratón */
}

.floating-music-button {
    /* Mantenemos la apariencia, quitamos el 'fixed' y las coordenadas ya que el contenedor padre las maneja */
    position: relative; 
    bottom: 0; 
    right: 0;

    background-color: rgba(244 196 86); 
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); 
    transition: background-color 0.3s ease, transform 0.2s ease;
    z-index: 900; 
}

.floating-music-button:hover {
    background-color: rgb(10, 10, 10); 
    transform: scale(1.05);
}

#music-icon { 
    width: 30px; 
    height: 30px;
    transform: translateX(2px);
}
/* -------------------------------------- */


/* Media Queries para responsividad */
@media (max-width: 768px) {
    .banner {
        padding: 150px 15px;
    }
    .main-title-section h1 {
        font-size: 2em;
    }
    .qr-image {
        width: 180px;
        height: 180px;
    }
    .footer {
        padding: 15px;
    }
    .logo-container img {
        max-width: 120px;
    }
    .social-icons {
        gap: 10px;
    }
    .social-icons a img {
        width: 30px;
        height: 30px;
    }
    .container {
        width: 95%;
        padding: 15px;
    }
    /* AJUSTE: Aplicamos el grid responsivo a las galerías restantes */
    #gallery, #note-gallery { 
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }
    .gallery-image-item, .note-item { 
        min-height: 120px;
    }
    .gallery-image-item img { 
        height: 120px;
    }
    .copyright-modal-content {
        width: 90%;
    }

    .tab-header-bar {
        justify-content: center; 
        padding-bottom: 5px;
    }
    .tab-header {
        flex-shrink: 0; 
        min-width: 120px; 
        font-size: 0.9em;
    }
    .tab-content-wrapper {
        padding: 15px;
    }
    
    /* MODIFICACIÓN: Ajuste del contenedor flotante para móviles */
    .music-control-container {
        bottom: 15px;
        right: 15px;
    }
    
    .floating-music-button {
        width: 50px;
        height: 50px;
    }
    #music-icon {
        width: 25px;
        height: 25px;
    }
    
    .download-buttons {
        flex-direction: row; 
        justify-content: center;
        gap: 10px;
    }
    .download-text {
        width: 100%; 
        margin-bottom: 5px;
        text-align: center;
    }
    .download-button {
        padding: 6px 12px;
        font-size: 0.85em;
        min-width: 60px;
    }
}