/**
 * ESTILOS PARA MURO DE FOTOS
 * CPES N.º 38
 */

.main-padding {
    padding: 60px 0;
}

/* SECCIÓN DE SUBIR */
.upload-section {
    text-align: center;
    margin-bottom: 50px;
}

.upload-section .btn {
    font-size: 1.1rem;
    padding: 15px 40px;
    margin-bottom: 15px;
}

.upload-note {
    color: #666;
    font-size: 0.95rem;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 40px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(0,0,0,0.3);
    animation: slideDown 0.3s ease;
    position: relative;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-small {
    max-width: 500px;
}

.modal-close {
    color: #aaa;
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: var(--azul-oscuro);
    transform: rotate(90deg);
}

.modal-content h3 {
    color: var(--azul-oscuro);
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.modal-subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 0.95rem;
}

/* FORMULARIO */
.upload-form {
    margin-top: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    color: var(--azul-oscuro);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Open Sans', sans-serif;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--verde-turismo);
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* FILE UPLOAD PERSONALIZADO */
.file-upload-wrapper {
    position: relative;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.file-upload-display {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: var(--gris-fondo);
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-display:hover {
    border-color: var(--verde-turismo);
    background: white;
}

.file-icon {
    font-size: 2rem;
}

.file-text {
    color: #666;
    font-weight: 600;
}

/* PREVIEW DE IMAGEN */
.preview-container {
    margin-top: 15px;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.preview-container img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    background: #f5f5f5;
}

.btn-remove-preview {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-preview:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.char-count,
.help-text {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #999;
}

.help-text a {
    color: var(--azul-claro);
    text-decoration: none;
}

.help-text a:hover {
    text-decoration: underline;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.form-actions .btn {
    flex: 1;
}

.mensaje-form {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    display: none;
}

.mensaje-form.exito {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mensaje-form.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* TUTORIAL */
.tutorial-steps {
    margin-top: 25px;
}

.tutorial-step {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: var(--gris-fondo);
    border-radius: 10px;
}

.step-number {
    min-width: 40px;
    height: 40px;
    background: var(--verde-turismo);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.tutorial-step strong {
    display: block;
    color: var(--azul-oscuro);
    margin-bottom: 5px;
}

.tutorial-step p {
    color: #666;
    font-size: 0.9rem;
}

/* FILTROS */
.filtros-muro {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.filtro-btn {
    padding: 10px 25px;
    background: white;
    border: 2px solid var(--azul-claro);
    border-radius: 25px;
    color: var(--azul-oscuro);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filtro-btn:hover {
    background: var(--azul-claro);
    color: white;
    transform: translateY(-2px);
}

.filtro-btn.active {
    background: var(--verde-turismo);
    border-color: var(--verde-turismo);
    color: white;
}

/* MURO DE FOTOS - ESTILO POLAROID MURAL */
.muro-grid {
    display: grid;
    /* CAMBIO: Bajamos de 210px a 180px para que entren más fotos */
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    /* CAMBIO: Reducimos el espacio entre fotos para aprovechar el ancho */
    gap: 15px;
    margin-bottom: 50px;
    padding: 20px 10px; /* Menos padding lateral */
    background: #f5f5f0;
    border-radius: 15px;
}

.foto-card {
    background: #ffffff;
    padding: 10px 10px 25px 10px; /* Más espacio abajo para el caption */
    border-radius: 3px;
    overflow: visible;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15), 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    transform-origin: center center;
    will-change: transform;
}

/* Rotaciones aleatorias para efecto mural */
.foto-card:nth-child(3n+1) {
    transform: rotate(-2deg);
}

.foto-card:nth-child(3n+2) {
    transform: rotate(1deg);
}

.foto-card:nth-child(3n+3) {
    transform: rotate(-1deg);
}

.foto-card:nth-child(5n) {
    transform: rotate(2deg);
}

/* Efecto "pin" o "cinta" arriba */
.foto-card::before {
    content: '📌';
    position: absolute;
    top: -8px;
    right: 8px;
    font-size: 1.2rem;
    z-index: 2;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Alternativa: cinta adhesiva (comenta el pin y descomenta esto si preferís) */
/*
.foto-card::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 25px;
    background: rgba(255, 255, 200, 0.5);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    z-index: 2;
}
*/

.foto-card:hover {
    transform: scale(1.08) rotate(0deg) !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
    z-index: 10;
}

.foto-imagen {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    border-radius: 2px;
}

.foto-info {
    padding: 10px 10px 10px;
    text-align: center;
}

.foto-descripcion {
    color: var(--texto);
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.85rem;
    line-height: 1.4;
    font-family: 'Permanent Marker', cursive, 'Comic Sans MS', cursive;
    color: #555;
}

.foto-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: #999;
    margin-top: 8px;
}

.foto-autor {
    color: var(--verde-turismo);
    font-weight: 600;
    font-size: 0.8rem;
}

.foto-fecha {
    font-size: 0.75rem;
}

/* INFO BOX */
.info-box {
    background: linear-gradient(135deg, var(--azul-claro), var(--azul-oscuro));
    color: white;
    padding: 40px;
    border-radius: 15px;
    margin-top: 50px;
}

.info-box h3 {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.info-box ul {
    list-style: none;
    padding: 0;
}

.info-box li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    font-size: 0.95rem;
    line-height: 1.6;
}

.info-box li:last-child {
    border-bottom: none;
}

/* LOADING */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 1.1rem;
}

/* LIGHTBOX */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    background: white;
    padding: 20px 20px 80px 20px;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-imagen {
    max-width: 100%;
    max-height: calc(90vh - 150px);
    object-fit: contain;
    display: block;
    border-radius: 4px;
}

.lightbox-info {
    padding: 20px;
    text-align: center;
}

.lightbox-descripcion {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--azul-oscuro);
    margin-bottom: 15px;
}

.lightbox-meta {
    font-size: 1rem;
    color: #666;
}

.lightbox-autor {
    color: var(--verde-turismo);
    font-weight: 600;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 50px;
    height: 50px;
    background: var(--azul-oscuro);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.lightbox-close:hover {
    background: var(--verde-turismo);
    transform: rotate(90deg) scale(1.1);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--azul-oscuro);
    font-weight: bold;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--verde-turismo);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* EMPTY STATE */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
}

.empty-state .emoji {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: var(--azul-oscuro);
    margin-bottom: 10px;
}

.empty-state p {
    color: #666;
    margin-bottom: 30px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        padding: 25px;
        width: 95%;
    }

    .form-actions {
        flex-direction: column;
    }

    .muro-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .foto-imagen {
        height: 200px;
    }

    .filtros-muro {
        gap: 8px;
    }

    .filtro-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
    }

    .info-box {
        padding: 25px;
    }

    .tutorial-step {
        flex-direction: column;
    }
}