:root {
    --primary-color: #9c27b0;
    --primary-gradient: linear-gradient(90deg, #9c27b0 0%, #673ab7 100%);
    --bg-page: #F3F3F3;
    --card-bg: rgba(255, 255, 255, 0.8);
    --text-dark: #1e293b;
    --text-muted: #64748b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-dark);
    overflow-x: hidden;
}

.gallery-section {
    padding: 40px 0; /* Mobile First */
    background-color: var(--bg-page);
}

@media (min-width: 1024px) {
    .gallery-section {
        padding: 80px 0;
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px; /* Mobile First */
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

@media (min-width: 768px) {
    .container {
        padding: 0 30px;
    }
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 50px;
    color: var(--text-dark);
    letter-spacing: -0.02em;
}

.gallery-container {
    position: relative;
    width: 100%;
    padding: 0; /* Mobile First */
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .gallery-container {
        padding: 0 80px;
    }
}

/* Swiper Styling */
.swiper {
    width: 100%;
    padding: 20px 0 60px !important; /* Padding lateral removido para alinhar o overflow: hidden */
    overflow: hidden; /* Isso impede que cards vizinhos apareçam debaixo das setas */
}

.swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
}

/* Card Styling */
.gallery-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 24px;
    overflow: hidden;
    width: 100%;
    max-width: 400px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.gallery-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(156, 39, 176, 0.15);
}

.card-image {
    width: 100%;
    height: 350px; /* Mais alto para caber o texto */
    overflow: hidden;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.2) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
}

.gallery-card:hover .card-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 100%);
}

.overlay-content h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.overlay-content p {
    font-size: 1rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.gallery-card:hover .card-image img {
    transform: scale(1.1);
}

.btn-galeria:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(156, 39, 176, 0.5);
    filter: brightness(1.1);
}

.swiper-button-next,
.swiper-button-prev {
    display: none !important; /* Mobile First */
}

@media (min-width: 1024px) {
    .swiper-button-next,
    .swiper-button-prev {
        display: flex !important;
        color: var(--text-dark) !important;
        background: #fff;
        width: 50px !important;
        height: 50px !important;
        border-radius: 50%;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        transition: all 0.3s ease;
        top: 50%;
        transform: translateY(-50%);
    }
}

.swiper-button-next {
    right: 0 !important;
}

.swiper-button-prev {
    left: 0 !important;
}

.swiper-pagination {
    bottom: 0 !important;
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 20px !important;
    font-weight: bold;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: var(--primary-gradient);
    color: #fff !important;
}

.swiper-pagination-bullet {
    background: var(--text-muted) !important;
    opacity: 0.3 !important;
    width: 10px !important;
    height: 10px !important;
    transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
    background: var(--primary-color) !important;
    opacity: 1 !important;
    width: 30px !important;
    border-radius: 5px !important;
}

/* Admin Access Button */
.admin-access {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.btn-admin {
    background: transparent;
    color: var(--text-dark);
    border: none;
    padding: 10px;
    cursor: pointer;
    opacity: 0.3;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-admin:hover {
    opacity: 0.8;
    color: var(--text-light);
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #1e293b;
    padding: 40px;
    border-radius: 24px;
    width: 100%;
    max-width: 450px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.modal-content.dashboard {
    max-width: 800px;
}

.modal h3 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    text-align: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    border-color: var(--primary-color);
}

.image-preview {
    margin-top: 10px;
    width: 100%;
    height: 120px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: none;
}

.image-preview span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

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

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-primary:hover {
    filter: brightness(1.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Dashboard Specific */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.items-table th {
    text-align: left;
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.items-table td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.actions-cell {
    display: flex;
    gap: 10px;
}

.btn-edit, .btn-delete {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-edit {
    background: #0ea5e9;
    color: white;
}

.btn-delete {
    background: #ef4444;
    color: white;
}

.inner-form {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hidden {
    display: none;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #10b981;
    color: white;
    padding: 15px 30px;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2000;
}

.toast.active {
    transform: translateY(0);
    opacity: 1;
}

.toast.error {
    background: #ef4444;
}

/* Adicionais Responsivos */
@media (max-width: 768px) {
    .section-title {
        font-size: 1.8rem;
    }
    
    .gallery-card {
        max-width: 100%;
    }

    .modal-content {
        padding: 20px;
        width: 95%;
        margin: 10px;
    }

    .modal-content.dashboard {
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-width: none;
        overflow-y: auto;
    }
}
