/* public/css/vws3-galleries-public.css */

/* --- Estilos Existentes (formulário de upload) --- */
#vws3-upload-form-container {
    background-color: #e6fafc;
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 5px;
    max-width: 600px;
    margin: 20px auto;
}

#vws3-upload-form-container h2 {
    text-align: center;
    color: #333;
    margin-top: 0;
}

#vws3-file-upload-form p {
    margin-bottom: 15px;
}

#vws3-file-upload-form label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

#vws3-file-upload-form input[type="text"],
#vws3-file-upload-form textarea,
#vws3-file-upload-form select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Garante que padding não aumente a largura */
}

#vws3-file-upload-form textarea {
    resize: vertical;
}

#vws3-file-upload-form select[multiple] {
    min-height: 100px;
}

.vws3-select-tags-cats {
    width: 100%;
}

#vws3-upload-progress-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 5px;
    margin-top: 15px;
    overflow: hidden; /* Garante que a barra não ultrapasse */
}

#vws3-upload-progress-bar {
    width: 0%;
    height: 25px;
    background-color: #4CAF50;
    text-align: center;
    line-height: 25px;
    color: white;
    border-radius: 5px;
    transition: width 0.3s ease-in-out;
}

#vws3-upload-progress-text {
    display: block;
    text-align: center;
    margin-top: 5px;
    font-weight: bold;
}

#vws3-upload-message {
    margin-top: 15px;
    text-align: center;
    font-weight: bold;
}

#vws3-upload-message span.success {
    color: green;
}

#vws3-upload-message span.error {
    color: red;
}

/* --- Novos Estilos para a Galeria --- */
#vws3-gallery-list-container {
    padding: 20px;
    background-color: #fff;
    border: 1px solid #eee;
    margin-top: 20px;
}

#vws3-gallery-list-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

/* Estilos do formulário de filtro */
#vws3-gallery-filters {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 30px;
    border-radius: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: space-between;
}

#vws3-gallery-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
}

.vws3-filter-group {
    flex: 1 1 calc(25% - 15px); /* 4 colunas em telas maiores */
    min-width: 200px; /* Largura mínima para cada filtro */
}
.vws3-filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}
.vws3-filter-group input[type="text"],
.vws3-filter-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
.vws3-filter-group select[multiple] {
    min-height: 80px;
}
.vws3-filter-buttons {
    flex: 1 1 100%; /* Botões ocupam a linha inteira */
    text-align: right;
    margin-top: 10px;
}
.vws3-filter-buttons .button {
    margin-left: 10px;
}


/* Grid da Galeria */
#vws3-gallery-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Responsivo, 4 colunas em telas maiores */
    gap: 20px;
    margin-top: 20px;
    min-height: 300px; /* Para mostrar "Carregando" */
    position: relative;
}

.vws3-gallery-item {
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 5px;
    text-align: left;
    background-color: #fdfdfd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* força o conteúdo para o topo */
}

.vws3-gallery-item .excluir {
  margin-top: auto;
}

.vws3-gallery-thumbnail {
    width: 100%;
    height: 180px; /* Altura fixa para thumbnails */
    overflow: hidden;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e9e9e9;
    border-radius: 4px;
}
.vws3-gallery-thumbnail img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Ou 'cover' dependendo do seu gosto */
    display: block;
}

.vws3-placeholder-image,
.vws3-placeholder-video {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    color: #888;
    background-color: #e0e0e0;
}
.vws3-placeholder-video .dashicons {
    font-size: 3em;
}

.vws3-gallery-meta p {
    margin: 5px 0;
    font-size: 0.9em;
    color: #555;
    line-height: 1.3;
}
.vws3-gallery-meta strong {
    color: #333;
}
.vws3-item-categories, .vws3-item-tags {
    font-style: italic;
}
.vws3-item-description {
    font-size: 0.85em;
    color: #777;
}

/* Paginação */
.vws3-gallery-pagination {
    text-align: center;
    margin-top: 30px;
}
.vws3-gallery-pagination a,
.vws3-gallery-pagination span {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-decoration: none;
    color: #0073aa;
    background-color: #f9f9f9;
}
.vws3-gallery-pagination a:hover {
    background-color: #e9e9e9;
}
.vws3-gallery-pagination span.current-page {
    background-color: #0073aa;
    color: #fff;
    border-color: #0073aa;
    font-weight: bold;
}
.vws3-gallery-pagination span.dots {
    border: none;
    background: none;
    color: #555;
}

/* Overlay de carregamento */
#vws3-gallery-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5em;
    color: #333;
    z-index: 10;
}
#vws3-gallery-items-wrap {
    position: relative;
    min-height: 300px;
}
.no-results {
    text-align: center;
    font-style: italic;
    color: #777;
    margin-top: 30px;
}

/* Item actions (Edit/Delete buttons) */
.vws3-item-actions {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
}
.vws3-item-actions .button {
    padding: 5px 10px;
    font-size: 0.85em;
}

/* Modal de Edição */
.vws3-modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

.vws3-modal-content {
    background-color: #fefefe;
    margin: 5% auto; /* 5% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 700px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
}

.vws3-modal-content h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.vws3-close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.vws3-close-button:hover,
.vws3-close-button:focus {
    color: black;
    text-decoration: none;
}

.vws3-modal-actions {
    margin-top: 20px;
    text-align: right;
}
.vws3-modal-actions .button {
    margin-left: 10px;
}

#vws3-edit-message {
    margin-top: 10px;
    text-align: center;
    font-weight: bold;
}
#vws3-edit-form p {
    margin-bottom: 10px;
}
#vws3-edit-form label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}
#vws3-edit-form input[type="text"],
#vws3-edit-form textarea,
#vws3-edit-form select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
#vws3_edit_file_display_name {
    display: block;
    padding: 8px;
    background-color: #e9e9e9;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1.1em;
    color: #555;
    word-break: break-all;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    #vws3-gallery-filter-form {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    .vws3-filter-group {
        flex: 1 1 calc(33.33% - 15px);
    }
}

@media (max-width: 768px) {
    #vws3-gallery-filters, #vws3-gallery-filter-form {
        flex-direction: column;
    }
    .vws3-filter-group {
        flex: 1 1 100%;
        min-width: unset;
    }
    .vws3-filter-buttons {
        text-align: center;
    }
    #vws3-gallery-items-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}
@media (max-width: 480px) {
    #vws3-gallery-items-grid {
        grid-template-columns: 1fr;
    }
    .vws3-gallery-item {
        padding: 10px;
    }
    .vws3-modal-content {
        width: 95%;
        margin: 20px auto;
    }
}