/**
 * Estilos do Frontend
 */

/* Container principal */
.wpdm-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Seção de filtros */
.wpdm-filter-section {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px !important;
}

.wpdm-filter-title {
    font-size: 18px;
    font-weight: 600;
    color: #333333;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #dee2e6;
}

/* Formulário de filtros */
.wpdm-filters-form {
    width: 100%;
    overflow-x: auto;
}

.wpdm-filter-row {
    display: flex !important;
    gap: 12px;
    align-items: center !important;
    flex-wrap: nowrap !important;
    min-width: max-content;
}

.wpdm-filter-field {
    flex: 0 0 auto !important;
    display: inline-block !important;
}

.wpdm-filter-field.wpdm-filter-search {
    flex: 1 1 auto !important;
    min-width: 250px;
}

.wpdm-filter-field label {
    display: none !important;
}

.wpdm-select,
.wpdm-input {
    width: 100%;
    min-width: 180px;
    padding: 10px 14px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    color: #495057;
    background-color: #ffffff;
    transition: all 0.3s ease;
    height: 42px;
    display: inline-block !important;
    vertical-align: middle !important;
}

.wpdm-date-input {
    cursor: pointer;
}

.wpdm-date-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.wpdm-date-input::-webkit-calendar-picker-indicator:hover {
    background-color: #f0f0f0;
}

.wpdm-select:focus,
.wpdm-input:focus {
    outline: none;
    border-color: #013aae;
    box-shadow: 0 0 0 3px rgba(1, 58, 174, 0.1);
}

.wpdm-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23495057' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.wpdm-input::placeholder {
    color: #adb5bd;
}

.wpdm-filter-actions {
    display: flex !important;
    gap: 10px !important;
    flex: 0 0 auto !important;
}

.wpdm-btn-search,
.wpdm-btn-clear {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    height: 42px;
    vertical-align: middle !important;
}

.wpdm-btn-search {
    background-color: #013aae;
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(1, 58, 174, 0.2);
}

.wpdm-btn-search:hover {
    background-color: #012a7e;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(1, 58, 174, 0.3);
}

.wpdm-btn-search svg {
    width: 16px;
    height: 16px;
}

.wpdm-btn-clear {
    background-color: #ffffff;
    color: #6c757d;
    border: 1px solid #ced4da;
}

.wpdm-btn-clear:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

/* Grid de downloads */
.wpdm-downloads-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding-top: 10px;
}

/* Card de download */
.wpdm-download-card {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.wpdm-download-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: #013aae;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.wpdm-download-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    border-color: #013aae;
}

.wpdm-download-card:hover::before {
    transform: scaleY(1);
}

.wpdm-download-title {
    font-size: 20px;
    font-weight: 700;
    color: #212529;
    margin: 0 0 16px 0;
    line-height: 1.4;
    letter-spacing: -0.02em;
}

.wpdm-download-content {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 20px;
    flex-grow: 1;
}

.wpdm-download-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    padding: 12px 0;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
    font-size: 13px;
    color: #6c757d;
}

.wpdm-download-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.wpdm-download-meta svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.wpdm-download-category-badge {
    display: inline-block;
    background-color: #e7f1ff;
    color: #013aae;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* Botão de download */
.wpdm-download-btn {
    background-color: #013aae;
    color: #ffffff;
    padding: 14px 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 6px rgba(1, 58, 174, 0.2);
}

.wpdm-download-btn:hover {
    background-color: #012a7e;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(1, 58, 174, 0.3);
}

.wpdm-download-btn:active {
    transform: translateY(0);
}

.wpdm-download-btn svg {
    width: 18px;
    height: 18px;
}

/* Mensagem sem downloads */
.wpdm-no-downloads {
    text-align: center;
    color: #6c757d;
    font-size: 16px;
    padding: 60px 20px;
    grid-column: 1 / -1;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

/* Responsividade - Tablet */
@media (max-width: 1024px) {
    .wpdm-downloads-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
    
    .wpdm-filter-section {
        padding: 20px;
    }
    
    .wpdm-filter-row {
        flex-wrap: wrap;
    }
    
    .wpdm-select,
    .wpdm-input {
        min-width: 150px;
    }
}

/* Responsividade - Mobile */
@media (max-width: 768px) {
    .wpdm-container {
        padding: 15px;
    }
    
    .wpdm-filter-section {
        padding: 18px;
    }
    
    .wpdm-filter-title {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .wpdm-filter-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }
    
    .wpdm-filter-field {
        width: 100% !important;
        flex: 1 1 100% !important;
    }
    
    .wpdm-select,
    .wpdm-input {
        width: 100% !important;
        min-width: 100% !important;
    }
    
    .wpdm-filter-field.wpdm-filter-search {
        min-width: 100% !important;
    }
    
    .wpdm-filter-actions {
        flex-direction: row !important;
        width: 100% !important;
        gap: 10px !important;
    }
    
    .wpdm-btn-search,
    .wpdm-btn-clear {
        flex: 1 !important;
        justify-content: center;
    }
    
    .wpdm-downloads-list {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .wpdm-download-card {
        padding: 20px;
    }
    
    .wpdm-download-title {
        font-size: 18px;
    }
    
    .wpdm-download-content {
        font-size: 13px;
    }
    
    .wpdm-download-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .wpdm-download-btn {
        width: 100%;
        padding: 16px 28px;
    }
}

/* Animação de fade */
.wpdm-download-card.hidden {
    display: none;
}

/* Loading state */
.wpdm-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

/* Badge de nova publicação */
.wpdm-badge-new {
    position: absolute;
    top: 16px;
    right: 16px;
    background-color: #28a745;
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
