/* Estilos para el Sistema de Compartir Fotos Mejorado */

/* Modal de Compartir Fotos */
.photo-modal {
    z-index: 1500;
}

.photo-content {
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 15px;
}

.photo-header {
    background: linear-gradient(135deg, var(--warm-orange), var(--sunset-orange));
    color: var(--text-light);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 15px 15px 0 0;
}

.photo-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-photo {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--text-light);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.close-photo:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Formulario de Compartir */
.photo-form-container {
    padding: 2rem;
    background: var(--text-light);
}

.photo-form-container .form-group {
    margin-bottom: 1.5rem;
}

.photo-form-container label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.photo-form-container input,
.photo-form-container textarea,
.photo-form-container select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: var(--transition);
    font-family: inherit;
}

.photo-form-container input:focus,
.photo-form-container textarea:focus,
.photo-form-container select:focus {
    outline: none;
    border-color: var(--warm-orange);
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
}

.photo-form-container textarea {
    resize: vertical;
    min-height: 100px;
}

/* Área de Subida de Fotos */
.photo-upload-group {
    margin-bottom: 2rem;
}

.photo-upload-area {
    border: 3px dashed #d0d0d0;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: #fafafa;
}

.photo-upload-area:hover,
.photo-upload-area.drag-over {
    border-color: var(--warm-orange);
    background: rgba(255, 140, 0, 0.05);
}

.upload-placeholder i {
    font-size: 3rem;
    color: var(--warm-orange);
    margin-bottom: 1rem;
}

.upload-placeholder p {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.upload-placeholder small {
    color: #666;
    font-size: 0.9rem;
}

/* Preview de Fotos */
.photo-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-preview {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: var(--transition);
}

.remove-preview:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

/* Modal de Galería */
.gallery-modal {
    z-index: 1400;
}

.gallery-content {
    width: 95%;
    max-width: 1200px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    border-radius: 15px;
    overflow: hidden;
}

.gallery-header {
    background: linear-gradient(135deg, var(--secondary-green), var(--accent-green));
    color: var(--text-light);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gallery-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gallery-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.gallery-controls select {
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-light);
    cursor: pointer;
}

.gallery-controls select option {
    background: var(--text-dark);
    color: var(--text-light);
}

.close-gallery {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--text-light);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.close-gallery:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Grid de Galería */
.gallery-grid {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: #f8f9fa;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    background: var(--text-light);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.gallery-image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-item:hover .gallery-image img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: var(--text-light);
    padding: 1rem;
    transform: translateY(100%);
    transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-info h4 {
    margin: 0 0 0.3rem 0;
    font-size: 1rem;
}

.gallery-info p {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.gallery-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
}

.gallery-stats span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.gallery-actions {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0f0f0;
}

.like-btn,
.share-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
}

.like-btn {
    color: #e74c3c;
}

.like-btn:hover {
    background: rgba(231, 76, 60, 0.1);
}

.share-btn {
    color: var(--secondary-green);
}

.share-btn:hover {
    background: rgba(74, 124, 89, 0.1);
}

/* Galería Vacía */
.empty-gallery {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-gallery i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #ddd;
}

.empty-gallery h4 {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.empty-gallery p {
    margin-bottom: 1.5rem;
}

/* Modal de Detalle de Foto */
.photo-detail-modal {
    z-index: 1600;
}

.photo-detail-content {
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 15px;
    position: relative;
}

.close-photo-detail {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.5);
    color: var(--text-light);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: var(--transition);
}

.close-photo-detail:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.photo-detail {
    display: grid;
    grid-template-columns: 1fr 350px;
    min-height: 500px;
}

.photo-images {
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-images img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.photo-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0 1rem;
}

.photo-nav button {
    background: rgba(0, 0, 0, 0.5);
    color: var(--text-light);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.photo-nav button:hover {
    background: rgba(0, 0, 0, 0.7);
}

.photo-info {
    background: var(--text-light);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.photo-header-detail h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-dark);
}

.photo-meta {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.9rem;
    color: #666;
}

.photo-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-badge {
    background: var(--light-green);
    color: var(--text-dark);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    align-self: flex-start;
}

.photo-description {
    flex: 1;
}

.photo-description p {
    line-height: 1.6;
    color: var(--text-dark);
}

.photo-actions-detail {
    display: flex;
    gap: 1rem;
}

.like-btn-detail,
.share-btn-detail {
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.like-btn-detail {
    background: #e74c3c;
    color: var(--text-light);
}

.like-btn-detail:hover {
    background: #c0392b;
}

.share-btn-detail {
    background: var(--secondary-green);
    color: var(--text-light);
}

.share-btn-detail:hover {
    background: var(--primary-green);
}

/* Comentarios */
.photo-comments {
    border-top: 1px solid #f0f0f0;
    padding-top: 1rem;
}

.photo-comments h4 {
    margin: 0 0 1rem 0;
    color: var(--text-dark);
}

.comments-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.comment {
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.comment strong {
    color: var(--secondary-green);
    font-size: 0.9rem;
}

.comment p {
    margin: 0.3rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.comment small {
    color: #666;
    font-size: 0.8rem;
}

.add-comment {
    display: flex;
    gap: 0.5rem;
}

.add-comment input {
    flex: 1;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.9rem;
}

.add-comment button {
    background: var(--secondary-green);
    color: var(--text-light);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.add-comment button:hover {
    background: var(--primary-green);
}

/* Modal de Compartir en Redes */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

.share-content {
    background: var(--text-light);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.share-content h4 {
    margin: 0 0 1.5rem 0;
    color: var(--text-dark);
}

.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    transition: var(--transition);
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.facebook:hover {
    background: #166fe5;
}

.share-btn.whatsapp {
    background: #25d366;
}

.share-btn.whatsapp:hover {
    background: #1da851;
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.twitter:hover {
    background: #0d8bd9;
}

.close-share {
    background: #6c757d;
    color: var(--text-light);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.close-share:hover {
    background: #5a6268;
}

/* Responsive */
@media (max-width: 768px) {
    .photo-content {
        width: 95%;
        margin: 2.5vh auto;
    }

    .photo-form-container {
        padding: 1.5rem;
    }

    .photo-upload-area {
        padding: 1.5rem;
    }

    .upload-placeholder i {
        font-size: 2rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
        padding: 1rem;
    }

    .photo-detail {
        grid-template-columns: 1fr;
    }

    .photo-images {
        min-height: 300px;
    }

    .photo-info {
        padding: 1rem;
    }

    .share-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .photo-content {
        width: 98%;
        margin: 1vh auto;
    }

    .photo-header {
        padding: 1rem;
    }

    .photo-form-container {
        padding: 1rem;
    }

    .photo-preview {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        padding: 0.5rem;
    }

    .gallery-item {
        margin-bottom: 1rem;
    }

    .photo-detail-content {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .photo-images {
        min-height: 250px;
    }

    .photo-actions-detail {
        flex-direction: column;
    }

    .add-comment {
        flex-direction: column;
    }

    .add-comment input {
        margin-bottom: 0.5rem;
    }
}