/* Gallery Section Melhorada */
.gallery {
    background: white;
}

/* Seção Antes/Depois */
.before-after-section {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 3rem;
    border-radius: 20px;
    margin-bottom: 4rem;
    text-align: center;
}

.before-after-section h3 {
    font-size: 2rem;
    margin-bottom: 2rem;
    background: linear-gradient(45deg, #4B0082, #0064FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.before-after-container {
    max-width: 600px;
    margin: 0 auto;
}

.before-after-slider {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    cursor: grab;
}

.before-after-slider:active {
    cursor: grabbing;
}

.before-image, .after-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.before-image {
    z-index: 2;
    clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
    transition: clip-path 0.3s ease;
}

.before-image img, .after-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ba-label {
    position: absolute;
    top: 20px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
}

.before-image .ba-label {
    left: 20px;
}

.after-image .ba-label {
    right: 20px;
}

.slider-handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: white;
    z-index: 3;
    transform: translateX(-50%);
    cursor: ew-resize;
}

.slider-line {
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #4B0082, #0064FF);
    box-shadow: 0 0 10px rgba(75, 0, 130, 0.5);
}

.slider-button {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    color: #4B0082;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    font-weight: bold;
}

.before-after-description {
    margin-top: 1.5rem;
    font-size: 1.1rem;
    color: #666;
    font-style: italic;
}

.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.gallery-item {
    width: 300px;
    height: 300px;
    flex-shrink: 0; 
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.real-work {
    border: 3px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(45deg, #FFD700, #FFA500) border-box;
}

.real-work img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.real-work:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 2rem 1.5rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.real-work:hover .gallery-overlay {
    transform: translateY(0);
}

.work-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #333;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.gallery-overlay h4 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.gallery-overlay p {
    opacity: 0.9;
    font-size: 0.9rem;
}

/* Placeholders */
.placeholder-work {
    background: linear-gradient(135deg, #e9ecef, #f8f9fa);
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-content {
    text-align: center;
    color: #666;
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.placeholder-content h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.placeholder-content p {
    font-size: 0.9rem;
    opacity: 0.8;
    font-style: italic;
}

/* Filtros */
.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.8rem 1.5rem;
    background: white;
    border: 2px solid #e9ecef;
    color: #666;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn:hover, .filter-btn.active {
    background: linear-gradient(45deg, #4B0082, #0064FF);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(75, 0, 130, 0.3);
}

/* Modal */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
}

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

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 2fr 1fr; /* Ajustado: menos espaço para a imagem */
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-height: 60vh; /* Reduzido de 70vh para 60vh */
    min-height: 400px;  /* Altura mínima para não ficar muito pequena */
}

.modal-info {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #4B0082, #0064FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.modal-tag {
    background: linear-gradient(45deg, #4B0082, #0064FF);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: rgba(0,0,0,0.8);
}

/* Responsive */
@media (max-width: 768px) {
    .before-after-slider {
        height: 300px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .modal-content {
        grid-template-columns: 1fr;
        max-height: 85vh; /* Reduzido também no mobile */
    }
    
    .modal-image {
        max-height: 50vh; /* Ainda menor no mobile */
        min-height: 300px;
    }
    
    .modal-info {
        padding: 1.5rem;
    }
    
    .before-after-section {
        padding: 2rem 1rem;
    }
}