/* ================================================
   GESTOR DE DOCUMENTOS – Estilos Frontend
   ================================================ */

/* ── FILTROS ── */
.gd-filters {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.gd-filter-group {
    margin-bottom: 12px;
}

.gd-filter-group--full {
    width: 100%;
}

.gd-filter-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.gd-filter-row .gd-filter-group {
    flex: 1;
    min-width: 160px;
    margin-bottom: 0;
}

.gd-filter-group--buttons {
    flex: 0 0 auto !important;
    min-width: auto !important;
}

.gd-filters label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: #333;
}

.gd-input,
.gd-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    color: #333;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.gd-input:focus,
.gd-select:focus {
    border-color: #6aa034;
    outline: none;
    box-shadow: 0 0 0 2px rgba(106, 160, 52, 0.15);
}

/* ── BOTONES ── */
.gd-btn-group {
    display: flex;
    gap: 8px;
}

.gd-btn {
    display: inline-block;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
    line-height: 1.4;
    white-space: nowrap;
}

.gd-btn--filter {
    background: #6aa034;
    color: #fff;
    border-color: #6aa034;
}

.gd-btn--filter:hover {
    background: #5a8a2c;
}

.gd-btn--reset {
    background: #fff;
    color: #555;
    border-color: #ccc;
}

.gd-btn--reset:hover {
    background: #f0f0f0;
}

.gd-btn--primary {
    background: #6aa034;
    color: #fff;
    border-color: #6aa034;
    font-size: 13px;
    padding: 6px 14px;
}

.gd-btn--primary:hover {
    background: #5a8a2c;
    color: #fff;
}

.gd-btn--outline {
    background: transparent;
    color: #6aa034;
    border-color: #6aa034;
    font-size: 13px;
    padding: 6px 14px;
}

.gd-btn--outline:hover {
    background: #6aa034;
    color: #fff;
}

/* ── CONTADOR DE RESULTADOS ── */
.gd-results-count {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
}

/* ── GRID ── */
.gd-grid {
    display: grid;
    gap: 24px;
}

.gd-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.gd-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.gd-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ── CARDS ── */
.gd-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.gd-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.gd-card__thumb {
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #e8e8e8;
}

.gd-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gd-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8e8e8, #d0d0d0);
}

.gd-card__placeholder .dashicons {
    font-size: 48px;
    color: #aaa;
    width: 48px;
    height: 48px;
}

.gd-card__body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.gd-card__title {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.gd-card__meta {
    font-size: 13px;
    color: #666;
    margin: 0 0 4px 0;
}

.gd-card__meta strong {
    color: #444;
}

.gd-card__excerpt {
    font-size: 13px;
    color: #777;
    margin: 8px 0 0;
    line-height: 1.4;
}

.gd-card__actions {
    margin-top: auto;
    padding-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── NO RESULTS ── */
.gd-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
    color: #888;
    font-size: 15px;
}

/* ── PAGINACIÓN ── */
.gd-pagination-wrap {
    margin-top: 32px;
    display: flex;
    justify-content: center;
}

.gd-pagination {
    display: flex;
    gap: 6px;
}

.gd-page {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    color: #333;
}

.gd-page:hover {
    background: #f0f0f0;
}

.gd-page--active {
    background: #6aa034;
    color: #fff;
    border-color: #6aa034;
}

/* ── LOADER ── */
.gd-loader {
    text-align: center;
    padding: 40px;
}

.gd-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e0e0e0;
    border-top-color: #6aa034;
    border-radius: 50%;
    animation: gd-spin 0.7s linear infinite;
    margin: 0 auto;
}

@keyframes gd-spin {
    to { transform: rotate(360deg); }
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
    .gd-grid--cols-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .gd-grid--cols-4,
    .gd-grid--cols-3 { grid-template-columns: repeat(2, 1fr); }

    .gd-filter-row {
        flex-direction: column;
        gap: 12px;
    }

    .gd-filter-row .gd-filter-group {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .gd-grid--cols-4,
    .gd-grid--cols-3,
    .gd-grid--cols-2 { grid-template-columns: 1fr; }
}
