/* Reseteo universal de márgenes y paddings */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* -------------------------------------- */
/* Definición de la Tipografía Ink Free  */
/* -------------------------------------- */
@font-face {
    font-family: "against-regular"; /* Este es el nombre que usarás en tus estilos */
    src: url('fonts/against-regular.woff') format('woff'), /* Ruta a tu archivo WOFF2 */
         url('fonts/against-regular.woff') format('woff');  /* Ruta a tu archivo WOFF */
    font-weight: normal;
    font-style: normal;
    font-display: swap; /* Muestra el texto con una fuente genérica mientras carga la personalizada */
}

/* -------------------------------------- */
/* Definición de la Tipografía Montserrat  */
/* -------------------------------------- */
@font-face {
    font-family: "against-regular";
    src: url('fonts/against-regular.woff') format('woff2'),
         url('fonts/against-regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #ffffff; /* Fondo de toda la página en blanco */
    color: #000000; /* Color de texto general en negro */
    line-height: 1.6;
}

.banner {
    position: relative;
    background-image: url('boda.jpg');
    background-size: cover;
    background-position: center;
    padding: 150px 20px; /* Padding para la versión de escritorio */
    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;
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #e0e0e0; /* Línea sutil */
}

.main-title-section h1 {
    font-family: "against-regular"; /* Título principal con la nueva tipografía */
    font-size: 2.8em;
    color: #1f3a35; /* Título principal en negro */
}

/* Estilo para la imagen del QR */
.qr-image {
    width: 250px; /* Nuevo tamaño del cuadrado del QR */
    height: 250px;
    object-fit: contain; /* Asegura que la imagen completa del QR se vea sin cortes */
    margin-top: 20px; /* Espacio entre el título y el QR */
    margin-bottom: 10px; /* Espacio debajo del QR */
    border-radius: 8px; /* Esquinas ligeramente redondeadas */
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
}

h2 {
    font-family: "against-regular"; /* H2 también con la nueva tipografía */
    color: #1f3a35; /* Títulos de sección en negro */
    margin-top: 30px;
    border-bottom: 1px solid #e0e0e0; /* Línea sutil para h2 */
    padding-bottom: 10px;
    text-align: center;
}

/* -------------------------------------- */
/* Nuevos estilos para los botones de descarga */
/* -------------------------------------- */
.download-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 8px;
    background-color: #f9f9f9;
}
.download-text {
    font-size: 0.9em;
    font-weight: 600;
    color: #1f3a35;
}
.download-button {
    text-decoration: none;
    color: #fff;
    background-color: #1f3a35;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
    transition: background-color 0.3s ease;
}
.download-button:hover {
    background-color: #979797;
}
/* -------------------------------------- */


/* 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;
}

/* Estilos específicos para el formulario de nota más curveado y fresco */
#noteForm {
    border-radius: 20px; /* Bordes más redondeados */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Sombra suave */
    background: linear-gradient(145deg, #ffffff, #e6e6e6); /* Degradado suave */
    padding: 25px; /* Más padding interno */
}

#uploadForm button, #noteForm button {
    padding: 12px 20px;
    background-color: #1f3a35; /* Botones en gris oscuro */
    color: white;
    border: none;
    border-radius: 25px; /* Botón redondeado */
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}
#uploadForm button:hover, #noteForm button:hover {
    background-color: #979797; /* Tono más oscuro al pasar el ratón */
}

/* Estilos para el área de texto de la nota y el nuevo campo de nombre */
/* Se aplica a noteText, noteName y ahora también a uploaderName */
#noteText, #noteName, #uploaderName {
    width: calc(100% - 20px); /* Ajusta el ancho */
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 15px; /* Bordes más redondeados para inputs */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1em;
    resize: vertical; /* Permite redimensionar verticalmente */
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1); /* Sombra interna para profundidad */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
#noteText:focus, #noteName:focus, #uploaderName:focus {
    border-color: #1f3a35;
    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; /* Oculta el radio button original */
}
.color-box {
    width: 30px;
    height: 30px;
    border-radius: 50%; /* Círculo */
    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; /* Borde más oscuro cuando está seleccionado */
    transform: scale(1.15); /* Efecto de crecimiento al seleccionar */
    box-shadow: 0 2px 6px rgba(51, 51, 51, 0.4);
}
/* Definición de colores */
.color-box.lightpink { background-color: #FFB6C1; } /* Rosa Claro */
.color-box.lightgreen { background-color: #90EE90; } /* Verde Pastel */
.color-box.black { background-color: #000000; } /* Negro */
.color-box.lightblue { background-color: #ADD8E6; } /* Azul Claro */

/* Nuevos estilos para el área de subida de archivos */
.upload-area {
    width: 100%;
    border: 2px dashed #000000; /* Punteado negro */
    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; /* Un ligero cambio de color al pasar el ratón */
}

.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;
}
.custom-file-input-wrapper,
.custom-file-upload-button {
    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 {
    margin-top: 20px;
    text-align: center;
    border: 1px dashed #ccc;
    padding: 15px;
    border-radius: 5px;
    min-height: 100px; /* Para que el borde se vea incluso vacío */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column; /* Añadido para apilar imagen y nombre si hay */
}
#image-preview img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px auto;
    border-radius: 5px;
}
/* Estilo para el nombre en la previsualización de imagen */
#image-preview .uploader-name-preview {
    font-size: 0.9em;
    color: #555;
    margin-top: 5px;
    font-style: italic; /* Para diferenciarlo */
}

/* Estilos para la previsualización de NOTA (Nueva Sección) */
#note-preview-section {
    margin-top: 20px;
    text-align: center;
    border: 1px dashed #ccc; /* Borde punteado para la sección de previsualización */
    padding: 15px;
    border-radius: 5px;
    min-height: 120px; /* Altura mínima para que el borde sea visible */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column; /* Centra el contenido verticalmente si es necesario */
}
#note-preview-section .note-preview { /* Estilo para el contenido REAL de la previsualización */
    padding: 15px;
    border-radius: 8px;
    min-height: 100px; /* Altura mínima de la nota previsualizada */
    display: flex;
    flex-direction: column; /* Para apilar nombre y texto */
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.1em;
    color: #000000; /* Color de texto por defecto en negro */
    word-wrap: break-word; /* Asegura que el texto largo se ajuste */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Sombra sutil para las notas */
    transition: background-color 0.3s ease, color 0.3s ease; /* Suavizar cambios de color */
    font-family: "Ink Free";
    font-size: 1.3em; /* Un poco más grande para las notas */
    line-height: 1.3;
    width: 100%; /* Ajuste para que ocupe el espacio del padre */
    box-sizing: border-box; /* Incluir padding en el ancho */
}
#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;
}

/* Colores de fondo para la previsualización de la nota */
#note-preview-section .note-preview.lightpink { background-color: #FFB6C1; }
#note-preview-section .note-preview.lightgreen { background-color: #90EE90; }
#note-preview-section .note-preview.black { background-color: #000000; color: #fff; } /* Fondo negro, texto blanco */
#note-preview-section .note-preview.lightblue { background-color: #ADD8E6; }


#message {
    margin-top: 20px;
    text-align: center;
    font-weight: bold;
}
#gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 30px;
}
/* Estilo para los contenedores de imagen con nombre */
.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;
}

/* Estilo para las notas en la galería */
.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 en negro */
    word-wrap: break-word; /* Asegura que el texto largo se ajuste */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out;
    font-family: "Ink Free";
    font-size: 1.3em;
    line-height: 1.3;
}
.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;
}

/* Colores de fondo y texto para las notas publicadas */
.note-item.lightpink { background-color: #FFB6C1; }
.note-item.lightgreen { background-color: #90EE90; }
.note-item.black { background-color: #000000; color: #fff; }
.note-item.lightblue { background-color: #ADD8E6; }

#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;
}

.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; /* Título del modal en negro */
}
.copyright-modal-content button {
    background-color: #333333; /* Botón del modal en gris oscuro */
    color: white;
    border: none;
    padding: 10px 20px;
    margin-top: 15px;
    cursor: pointer;
    border-radius: 25px;
}
.copyright-modal-content button:hover {
    background-color: #1a1a1a;
}

/* 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);
}

/* Estilos para el nuevo botón de seleccionar archivo */
/* Se han movido y actualizado para el nuevo diseño */
.custom-file-input-wrapper,
.custom-file-upload-button {
    display: none; /* Ocultamos el wrapper original del botón */
}
#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;
}

/* 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;
    }
    #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%;
    }
}