/**
 * Archive Styles für IT Expert Cards Templates
 * Stellt sicher, dass der Content bündig mit dem Header abschließt
 * 
 * @package IT_Expert_Hub
 * @version 1.0
 */

/* ================================================
   CSS-VARIABLEN FÜR FARB-THEMES
   ================================================ */

/* Expert Archive - Blau */
.expert-archive-wrapper {
    --archive-primary: #0066cc;
    --archive-secondary: #0052a3;
    --archive-accent: #3399ff;
    --archive-text: #003d7a;
}

/* Company Archive - Grün (wird ggf. im Template überschrieben) */
.company-archive-wrapper {
    --archive-primary: #059669;
    --archive-secondary: #10b981;
    --archive-accent: #34d399;
    --archive-text: #064e3b;
}

/* Event Archive - Lila (wird ggf. im Template überschrieben) */
.event-archive-wrapper {
    --archive-primary: #7c3aed;
    --archive-secondary: #8b5cf6;
    --archive-accent: #a78bfa;
    --archive-text: #5b21b6;
}

/* ================================================
   ALLGEMEINE ARCHIVE-STYLES
   ================================================ */

/* Archive Wrapper - liegen INNERHALB des .container, daher volle Breite */
.expert-archive-wrapper,
.company-archive-wrapper,
.event-archive-wrapper {
    width: 100%;
    box-sizing: border-box;
}

/* Filter- und Content-Sections innerhalb des Wrappers */
.expert-filters-section,
.company-filters-section,
.event-filters-section,
.expert-archive-content,
.company-archive-content,
.event-archive-content {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Filter Container - Gleiche Breite wie Plugin Header und normale Pages */
.filter-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin: 40px 0;
    box-sizing: border-box;
}

/* Such-Elemente - NEU: Suchfeld links, Button rechts, Filter darunter */
.search-bar-main {
    display: grid;
    grid-template-columns: 1fr auto auto auto auto;
    gap: 16px;
    padding: 20px;
    align-items: center;
}

/* Erste Zeile: Suchfeld und Button */
.search-input-wrapper {
    grid-column: 1 / 5;
    grid-row: 1;
    position: relative;
    width: 100%;
}

.btn-search-submit {
    grid-column: 5;
    grid-row: 1;
}

/* Zweite Zeile: Filter, Sort, View-Toggle horizontal */
.search-bar-main .btn-toggle-filters {
    grid-column: 1;
    grid-row: 2;
}

.search-bar-main .sort-select {
    grid-column: 2;
    grid-row: 2;
}

.search-bar-main .view-toggle-buttons {
    grid-column: 5;
    grid-row: 2;
    justify-self: end;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    display: flex;
    align-items: center;
    pointer-events: none;
}

.main-search-input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.main-search-input:focus {
    outline: none;
    border-color: var(--archive-primary, #0066cc);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
}

/* Buttons */
.btn-search-submit,
.btn-toggle-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-search-submit {
    background: var(--archive-primary, #0066cc);
    color: #ffffff;
}

.btn-search-submit:hover {
    background: var(--archive-secondary, #0052a3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.btn-toggle-filters {
    background: #f8f9fa;
    color: #333333;
    border: 2px solid #e0e0e0;
}

.btn-toggle-filters:hover {
    background: #ffffff;
    border-color: var(--archive-primary, #0066cc);
    color: var(--archive-primary, #0066cc);
}

.btn-toggle-filters.active {
    background: var(--archive-primary, #0066cc);
    color: #ffffff;
    border-color: var(--archive-primary, #0066cc);
}

/* Sortierung */
.sort-select {
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-select:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
}

/* View Toggle */
.view-toggle-buttons {
    display: flex;
    gap: 4px;
    background: #f8f9fa;
    padding: 4px;
    border-radius: 12px;
}

.view-toggle-btn {
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.view-toggle-btn:hover {
    background: rgba(0,0,0,0.05);
}

.view-toggle-btn.active {
    background: white;
    color: #0066cc;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Filter Panel */
.filters-panel {
    border-top: 2px solid #f0f0f0;
    background: #fafbfc;
    display: none;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.filters-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #1a1a1a;
}

.btn-close-filters {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #666;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.btn-close-filters:hover {
    background: #e0e0e0;
    color: #333;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 24px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-label svg {
    color: #0066cc;
}

.filter-input,
.filter-select {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #fff;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.radio-option:hover {
    border-color: #0066cc;
    background: #f8f9fa;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.status-available {
    background: #28a745;
}

.status-dot.status-limited {
    background: #ffc107;
}

.status-dot.status-booked {
    background: #dc3545;
}

.filters-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-top: 1px solid #e0e0e0;
    background: #fff;
}

.btn-reset-filters,
.btn-apply-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-reset-filters {
    background: #fff;
    color: #666;
    border: 2px solid #e0e0e0;
}

.btn-reset-filters:hover {
    background: #f8f9fa;
    border-color: #999;
    color: #333;
}

.btn-apply-filters {
    background: #0066cc;
    color: #fff;
}

.btn-apply-filters:hover {
    background: #0052a3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

/* Aktive Filter Tags */
.active-filters-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #f8f9fa;
    border-top: 2px solid #e0e0e0;
    flex-wrap: wrap;
}

.active-filters-label {
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

.active-filters-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #0066cc;
    color: #fff;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.remove-filter {
    background: rgba(255,255,255,0.2);
    border: none;
    padding: 4px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.remove-filter:hover {
    background: rgba(255,255,255,0.3);
}

.clear-all-filters {
    padding: 6px 14px;
    background: #fff;
    color: #666;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.clear-all-filters:hover {
    background: #e0e0e0;
    color: #333;
}

/* Results Header */
.results-header {
    margin-bottom: 25px;
    padding: 15px 20px;
    background: #f8fafc;
    border-radius: 8px;
}

.results-count {
    font-weight: 600;
    color: #1e293b;
    font-size: 1.125rem;
}

/* Cards Grid */
.expert-cards-grid,
.company-cards-grid {
    display: grid;
    gap: 30px;
    margin-bottom: 40px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.expert-cards-grid[data-columns="1"],
.company-cards-grid[data-columns="1"] {
    grid-template-columns: 1fr;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.expert-cards-grid[data-columns="2"],
.company-cards-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.expert-cards-grid[data-columns="3"],
.company-cards-grid[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.expert-cards-grid[data-columns="4"],
.company-cards-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

/* Pagination */
.expert-pagination,
.company-pagination,
.event-pagination {
    margin-top: 40px;
    text-align: center;
}

.expert-pagination .pagination,
.company-pagination .pagination,
.event-pagination .pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    list-style: none;
    padding: 0;
    flex-wrap: wrap;
}

.expert-pagination .page-numbers,
.company-pagination .page-numbers,
.event-pagination .page-numbers {
    padding: 10px 16px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.expert-pagination .page-numbers:hover,
.company-pagination .page-numbers:hover,
.event-pagination .page-numbers:hover,
.expert-pagination .page-numbers.current,
.company-pagination .page-numbers.current,
.event-pagination .page-numbers.current {
    background: #0066cc;
    color: #fff;
}

/* No Results */
.no-experts-found,
.no-results {
    text-align: center;
    padding: 80px 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.no-results-icon {
    font-size: 64px;
    color: #ccc;
    margin-bottom: 20px;
}

.no-results-icon .dashicons {
    width: 64px;
    height: 64px;
    font-size: 64px;
}

.no-experts-found h2,
.no-results h3 {
    font-size: 1.8rem;
    color: #333;
    margin: 0 0 15px 0;
}

.no-experts-found p,
.no-results p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
}

/* ================================================
   RESPONSIVE BREAKPOINTS
   ================================================ */

@media (max-width: 1200px) {
    .expert-cards-grid[data-columns="4"],
    .company-cards-grid[data-columns="4"] {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .expert-cards-grid[data-columns="3"],
    .expert-cards-grid[data-columns="4"],
    .company-cards-grid[data-columns="3"],
    .company-cards-grid[data-columns="4"] {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .expert-archive-wrapper,
    .company-archive-wrapper,
    .event-archive-wrapper {
        padding: 20px 15px;
    }
    
    .search-bar-main {
        flex-direction: column;
    }
    
    .search-input-wrapper {
        min-width: 100%;
    }
    
    .btn-search-submit,
    .btn-toggle-filters {
        width: 100%;
        justify-content: center;
    }
    
    .sort-select {
        width: 100%;
    }
    
    .view-toggle-buttons {
        width: 100%;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-footer {
        flex-direction: column;
        gap: 12px;
    }
    
    .btn-reset-filters,
    .btn-apply-filters {
        width: 100%;
        justify-content: center;
    }
    
    .expert-cards-grid,
    .company-cards-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .results-header {
        padding: 12px 15px;
    }
    
    .results-count {
        font-size: 1rem;
    }
    
    .active-filters-display {
        flex-direction: column;
        align-items: flex-start;
    }
}
