/* Estilos para Página de Galeria */

/* Seção Hero */
.gallery-hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #0ea5e9 100%);
    padding: 3rem 1rem;
    text-align: center;
    color: white;
}

.gallery-hero h1 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

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

/* Barra de Admin */
.admin-bar {
    background: #f3f4f6;
    padding: 1rem;
    text-align: center;
    border-bottom: 2px solid #e5e7eb;
}

.btn-admin-login {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-admin-login:hover {
    background: #d97706;
    transform: scale(1.05);
}

/* Seção de Galeria */
.gallery-section {
    padding: 2rem 0;
}

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

.filter-btn {
    background: white;
    border: 2px solid #e5e7eb;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: #0ea5e9;
    color: #0ea5e9;
}

.filter-btn.active {
    background: #1e3a8a;
    color: white;
    border-color: #1e3a8a;
}

/* Grid de Galeria */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    animation: fadeIn 0.5s ease-out;
}

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

/* Item da Galeria */
.gallery-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.gallery-item-media {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: linear-gradient(135deg, #1e3a8a 0%, #0ea5e9 100%);
    position: relative;
}

.gallery-item-type {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.gallery-item-content {
    padding: 1rem;
}

.gallery-item-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e3a8a;
    margin-bottom: 0.5rem;
}

.gallery-item-description {
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.gallery-item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-view {
    flex: 1;
    background: #0ea5e9;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-view:hover {
    background: #0284c7;
}

.btn-delete {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: none;
}

.btn-delete:hover {
    background: #dc2626;
}

body.admin-mode .btn-delete {
    display: inline-block;
}

/* Mensagem Vazia */
.empty-gallery {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.empty-gallery p {
    font-size: 1.2rem;
    color: #6b7280;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: slideUp 0.3s ease-out;
    margin: 2rem auto;
}

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

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #1f2937;
}

/* Modal Login */
.modal-login {
    max-width: 400px;
}

.modal-login h2 {
    color: #1e3a8a;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* Botões */
.btn-save,
.btn-cancel {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.btn-save {
    background: #10b981;
    color: white;
}

.btn-save:hover {
    background: #059669;
    transform: scale(1.02);
}

.btn-cancel {
    background: #e5e7eb;
    color: #1f2937;
}

.btn-cancel:hover {
    background: #d1d5db;
}

/* Painel de Upload */
.upload-panel {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 500px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.2);
    z-index: 3000;
    overflow-y: auto;
    animation: slideInRight 0.3s ease-out;
}

.upload-panel.active {
    display: block;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.upload-panel-header {
    background: #1e3a8a;
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.upload-panel-header h2 {
    margin: 0;
}

.btn-close-panel {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.btn-close-panel:hover {
    transform: scale(1.2);
}

.upload-panel-content {
    padding: 1.5rem;
}

.upload-form {
    background: #f3f4f6;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.file-preview {
    margin-top: 1rem;
    max-width: 100%;
}

.file-preview img,
.file-preview video {
    width: 100%;
    max-width: 200px;
    border-radius: 6px;
}

.btn-upload {
    width: 100%;
    background: #10b981;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-upload:hover {
    background: #059669;
    transform: translateY(-2px);
}

/* Lista de Uploads */
.uploaded-items {
    background: #f3f4f6;
    padding: 1rem;
    border-radius: 8px;
}

.uploaded-items h3 {
    color: #1e3a8a;
    margin-top: 0;
}

.uploaded-list {
    max-height: 300px;
    overflow-y: auto;
}

.uploaded-item {
    background: white;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.uploaded-item-name {
    font-weight: 600;
    color: #1e3a8a;
    flex: 1;
}

.uploaded-item-delete {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.uploaded-item-delete:hover {
    background: #dc2626;
}

/* Modal View */
.modal-view {
    max-width: 800px;
}

.view-content {
    width: 100%;
    margin-bottom: 1rem;
}

.view-content img,
.view-content video {
    width: 100%;
    border-radius: 8px;
}

.view-info {
    text-align: center;
}

.view-info h2 {
    color: #1e3a8a;
    margin-bottom: 0.5rem;
}

.view-info p {
    color: #6b7280;
    line-height: 1.6;
}

/* Responsividade */
@media (max-width: 768px) {
    .gallery-hero h1 {
        font-size: 2.5rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .upload-panel {
        max-width: 100%;
    }

    .gallery-filters {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 600px) {
    .gallery-hero h1 {
        font-size: 2rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .gallery-item-media {
        height: 150px;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }

    .upload-panel {
        max-width: 100%;
    }

    .upload-panel-content {
        padding: 1rem;
    }
}
