/* ========================================
   ARTICLES.CSS
   Styles for articles page
======================================== */

/* ----------------------------------------
   SEARCH SECTION
---------------------------------------- */
.search-section {
    padding: 30px 40px;
    background: rgba(245, 245, 220, 0.8);
    border-bottom: 2px solid rgba(139, 69, 19, 0.2);
}

.search-container {
    position: relative;
    margin-bottom: 25px;
}

/* Search input field */
.search-input {
    width: 100%;
    padding: 18px 50px 18px 20px;
    border: 2px solid #D2691E;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #8B4513;
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #8B4513;
    font-size: 20px;
}

/* ----------------------------------------
   FILTERS SECTION
---------------------------------------- */
.filters-row {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-label {
    font-weight: bold;
    color: #2c1810;
    font-size: 14px;
    min-width: 60px;
}

/* ----------------------------------------
   TYPE FILTER BUTTONS
---------------------------------------- */
.type-buttons {
    display: flex;
    gap: 8px;
}

.type-btn {
    padding: 10px 18px;
    border: 2px solid #D2691E;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
}

.type-btn:hover {
    border-color: #8B4513;
    transform: translateY(-1px);
}

.type-btn.active {
    background: linear-gradient(135deg, #8B4513, #A0522D);
    color: white;
    border-color: transparent;
}

/* ----------------------------------------
   CATEGORY DROPDOWN
---------------------------------------- */
.dropdown-container {
    position: relative;
    min-width: 250px;
}

.dropdown-btn {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #D2691E;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    color: #2c1810;
}

.dropdown-btn:hover {
    border-color: #8B4513;
}

/* Dropdown content panel */
.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #D2691E;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.dropdown-content.show {
    display: block;
}

/* Search within dropdown */
.dropdown-search {
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    background: white;
}

.dropdown-search input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Dropdown items */
.dropdown-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    transition: background 0.2s ease;
    color: #2c1810;
}

.dropdown-item:hover {
    background: rgba(139, 69, 19, 0.1);
}

.dropdown-item.selected {
    background: rgba(139, 69, 19, 0.2);
    font-weight: bold;
}

/* ----------------------------------------
   DATE FILTER STYLES
---------------------------------------- */
/* Date filter group container */
.filter-group:has(.date-inputs-container) {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-width: 320px;
}

.filter-group:has(.date-inputs-container) .filter-label {
    align-self: center;
    margin-top: 0;
    line-height: 1.2;
}

.date-filter-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

/* Date inputs main container */
.date-inputs-container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Individual date input wrapper */
.date-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Date input labels */
.date-input-label {
    font-size: 12px;
    color: #4a2c17;
    font-weight: 500;
}

/* Date input fields */
.date-input {
    padding: 10px 12px;
    border: 2px solid #D2691E;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    color: #2c1810;
    transition: all 0.3s ease;
    width: 140px;
}

.date-input:focus {
    outline: none;
    border-color: #8B4513;
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.date-input::-webkit-calendar-picker-indicator {
    color: #8B4513;
    cursor: pointer;
}

/* Date separator */
.date-separator {
    color: #8B4513;
    font-weight: bold;
    font-size: 16px;
    align-self: flex-end;
    margin-bottom: 10px;
}

/* Clear dates button */
.clear-dates-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
    align-self: flex-end;
    margin-bottom: 10px;
}

.clear-dates-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Quick date selection buttons */
.quick-date-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.quick-date-btn {
    padding: 6px 12px;
    border: 1px solid #D2691E;
    background: white;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    color: #8B4513;
    font-weight: 500;
}

.quick-date-btn:hover {
    background: rgba(139, 69, 19, 0.1);
    border-color: #8B4513;
}

.quick-date-btn.active {
    background: #8B4513;
    color: white;
    border-color: #8B4513;
}

/* ----------------------------------------
   RESULTS HEADER
---------------------------------------- */
.results-header {
    padding: 20px 40px;
    background: rgba(245, 245, 220, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(139, 69, 19, 0.2);
}

/* Results counter */
.results-count {
    color: #4a2c17;
    font-weight: bold;
    font-size: 16px;
}

/* ----------------------------------------
   SORT CONTROLS
---------------------------------------- */
.sort-container {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2c1810;
}

.sort-select {
    padding: 8px 12px;
    border: 1px solid #D2691E;
    border-radius: 6px;
    background: white;
    cursor: pointer; /* AJOUT */
}

.sort-select:hover {
    border-color: #8B4513;
}

/* ----------------------------------------
  RESPONSIVE DESIGN
---------------------------------------- */

/* Large tablets and medium screens */
@media (max-width: 1024px) {
   .search-section {
       padding: 25px 35px;
   }
   
   .search-container {
       margin-bottom: 20px;
   }
   
   .search-input {
       padding: 16px 45px 16px 18px;
       font-size: 15px;
       border-radius: 8px;
   }
   
   .search-icon {
       right: 12px;
       font-size: 18px;
   }
   
   .filters-row {
       gap: 30px;
   }
   
   .filter-label {
       font-size: 13px;
       min-width: 55px;
   }
   
   .type-btn {
       padding: 9px 16px;
       font-size: 13px;
   }
   
   .dropdown-container {
       min-width: 220px;
   }
   
   .dropdown-btn {
       padding: 11px 14px;
       font-size: 14px;
   }
   
   .filter-group:has(.date-inputs-container) {
       min-width: 280px;
   }
   
   .date-input {
       padding: 9px 11px;
       font-size: 13px;
       width: 130px;
   }
   
   .date-input-label {
       font-size: 11px;
   }
   
   .clear-dates-btn {
       width: 26px;
       height: 26px;
       font-size: 13px;
   }
   
   .quick-date-btn {
       padding: 5px 10px;
       font-size: 11px;
   }
   
   .results-header {
       padding: 18px 35px;
   }
   
   .results-count {
       font-size: 15px;
   }
   
   .sort-select {
       padding: 7px 11px;
       font-size: 14px;
   }

    .sort-container label {
        font-size: 14px;
    }
}

/* Tablets */
@media (max-width: 768px) {
   .search-section {
       padding: 20px 25px;
   }
   
   .search-container {
       margin-bottom: 18px;
   }
   
   .search-input {
       padding: 14px 40px 14px 16px;
       font-size: 14px;
   }
   
   .search-icon {
       right: 10px;
       font-size: 16px;
   }
   
   .filters-row {
       gap: 20px;
       flex-direction: column;
       align-items: stretch;
   }
   
   .filter-group {
       flex-direction: column;
       align-items: stretch;
       gap: 8px;
   }
   
   .filter-label {
       font-size: 12px;
       min-width: auto;
       text-align: left;
   }
   
   .type-buttons {
       gap: 6px;
       flex-wrap: wrap;
   }
   
   .type-btn {
       padding: 8px 14px;
       font-size: 12px;
       flex: 1;
       min-width: 70px;
   }
   
   .dropdown-container {
       min-width: auto;
       width: 100%;
   }
   
   .dropdown-btn {
       padding: 10px 12px;
       font-size: 13px;
   }
   
   .dropdown-content {
       max-height: 250px;
   }
   
   .dropdown-item {
       padding: 8px 12px;
       font-size: 13px;
   }
   
   .filter-group:has(.date-inputs-container) {
       min-width: auto;
       flex-direction: column;
       align-items: stretch;
   }
   
   .filter-group:has(.date-inputs-container) .filter-label {
       align-self: stretch;
       text-align: left;
   }
   
   .date-filter-content {
       gap: 10px;
   }
   
   .date-inputs-container {
       gap: 10px;
       justify-content: space-between;
   }
   
   .date-input-wrapper {
       flex: 1;
   }
   
   .date-input {
       width: 100%;
       padding: 8px 10px;
       font-size: 12px;
   }
   
   .date-input-label {
       font-size: 10px;
   }
   
   .date-separator {
       font-size: 14px;
       align-self: center;
       margin-bottom: 0;
   }
   
   .clear-dates-btn {
       width: 24px;
       height: 24px;
       font-size: 12px;
       align-self: center;
       margin-bottom: 0;
   }
   
   .quick-date-buttons {
       gap: 4px;
       justify-content: center;
   }
   
   .quick-date-btn {
       padding: 4px 8px;
       font-size: 10px;
       flex: 1;
       text-align: center;
   }
   
   .results-header {
       padding: 15px 25px;
       flex-direction: column;
       gap: 10px;
       align-items: stretch;
   }
   
   .results-count {
       font-size: 14px;
       text-align: center;
   }
   
   .sort-container {
       justify-content: center;
   }
   
   .sort-select {
       padding: 6px 10px;
       font-size: 13px;
   }

    .sort-container label {
        font-size: 13px;
    }
}

/* Small tablets and large phones */
@media (max-width: 600px) {
   .search-section {
       padding: 18px 20px;
   }
   
   .search-container {
       margin-bottom: 15px;
   }
   
   .search-input {
       padding: 12px 35px 12px 14px;
       font-size: 13px;
       border-radius: 6px;
   }
   
   .search-icon {
       right: 8px;
       font-size: 14px;
   }
   
   .filters-row {
       gap: 15px;
   }
   
   .filter-group {
       gap: 6px;
   }
   
   .filter-label {
       font-size: 11px;
   }
   
   .type-buttons {
       gap: 4px;
   }
   
   .type-btn {
       padding: 6px 10px;
       font-size: 11px;
       border-radius: 20px;
   }
   
   .dropdown-btn {
       padding: 8px 10px;
       font-size: 12px;
       border-radius: 6px;
   }
   
   .dropdown-content {
       max-height: 200px;
       border-radius: 0 0 6px 6px;
   }
   
   .dropdown-search {
       padding: 8px;
   }
   
   .dropdown-search input {
       padding: 6px;
       font-size: 12px;
   }
   
   .dropdown-item {
       padding: 6px 10px;
       font-size: 12px;
   }
   
   .date-filter-content {
       gap: 8px;
   }
   
   .date-inputs-container {
       gap: 8px;
       flex-direction: column;
   }
   
   .date-input-wrapper {
       width: 100%;
   }
   
   .date-input {
       padding: 6px 8px;
       font-size: 11px;
       border-radius: 6px;
   }
   
   .date-separator {
       display: none;
   }
   
   .clear-dates-btn {
       width: 22px;
       height: 22px;
       font-size: 11px;
       align-self: center;
   }
   
   .quick-date-buttons {
       gap: 3px;
   }
   
   .quick-date-btn {
       padding: 3px 6px;
       font-size: 9px;
       border-radius: 12px;
   }
   
   .results-header {
       padding: 12px 20px;
       gap: 8px;
   }
   
   .results-count {
       font-size: 13px;
   }
   
   .sort-select {
       padding: 5px 8px;
       font-size: 12px;
       border-radius: 4px;
   }

    .sort-container label {
        font-size: 12px;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
   .search-section {
       padding: 15px 16px;
   }
   
   .search-container {
       margin-bottom: 12px;
   }
   
   .search-input {
       padding: 10px 30px 10px 12px;
       font-size: 12px;
   }
   
   .search-icon {
       right: 6px;
       font-size: 12px;
   }
   
   .filters-row {
       gap: 12px;
   }
   
   .filter-group {
       gap: 4px;
   }
   
   .filter-label {
       font-size: 10px;
   }
   
   .type-buttons {
       gap: 3px;
   }
   
   .type-btn {
       padding: 5px 8px;
       font-size: 10px;
       min-width: 60px;
   }
   
   .dropdown-btn {
       padding: 6px 8px;
       font-size: 11px;
   }
   
   .dropdown-content {
       max-height: 180px;
   }
   
   .dropdown-search {
       padding: 6px;
   }
   
   .dropdown-search input {
       padding: 4px;
       font-size: 11px;
   }
   
   .dropdown-item {
       padding: 5px 8px;
       font-size: 11px;
   }
   
   .date-filter-content {
       gap: 6px;
   }
   
   .date-inputs-container {
       gap: 6px;
   }
   
   .date-input {
       padding: 5px 6px;
       font-size: 10px;
   }
   
   .date-input-label {
       font-size: 9px;
   }
   
   .clear-dates-btn {
       width: 20px;
       height: 20px;
       font-size: 10px;
   }
   
   .quick-date-buttons {
       gap: 2px;
   }
   
   .quick-date-btn {
       padding: 2px 4px;
       font-size: 8px;
       border-radius: 10px;
   }
   
   .results-header {
       padding: 10px 16px;
       gap: 6px;
   }
   
   .results-count {
       font-size: 12px;
   }
   
   .sort-container {
       gap: 6px;
   }
   
   .sort-select {
       padding: 4px 6px;
       font-size: 11px;
   }

    .sort-container label {
        font-size: 11px;
    }
}