/**
 * Search Results Styles - Assemblée Nationale de Madagascar
 * Following the official graphic chart visualization
 */

/* Base Variables */
:root {
    --green: #0E8040;
    --dark-green: #0A6030;
    --red: #ED2024;
    --white: #FFFFFF;
    --black: #000000;
    --gold: #D4AF37;
    --light-gray: #F5F5F5;
    --medium-gray: #666666;
    --dark-gray: #333333;
    --border-gray: #E0E0E0;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 5px 15px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Search Header */
.search-header {
    background-color: var(--light-gray);
    padding: var(--p-xl) 0 var(--p-lg);
    margin-bottom: var(--p-lg);
    border-bottom: 1px solid var(--border-gray);
}

.search-header h1 {
    font-size: 2rem;
    color: var(--dark-gray);
    margin-bottom: var(--p-md);
    position: relative;
    padding-bottom: var(--p-sm);
    font-weight: 700;
}

.search-header h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background-color: var(--green);
}

.search-stats {
    color: var(--medium-gray);
    margin-bottom: var(--p-md);
    font-size: 1rem;
}

/* Search Form */
.search-form-container {
    max-width: 600px;
    margin: 0 auto;
}

.search-form {
    display: flex;
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-gray);
    box-shadow: var(--shadow-light);
}

.search-input {
    flex: 1;
    padding: var(--p-md);
    border: none;
    font-size: 1rem;
    outline: none;
    font-family: 'Roboto', sans-serif;
}

.search-button {
    background-color: var(--green);
    color: var(--white);
    border: none;
    padding: 0 var(--p-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.search-button:hover {
    background-color: var(--dark-green);
}

/* Search Filters */
.search-filters {
    margin-bottom: var(--p-xl);
    padding: var(--p-md) 0;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--p-sm);
    justify-content: center;
}

.filter-button {
    background-color: var(--white);
    border: 1px solid var(--border-gray);
    border-radius: 20px;
    padding: var(--p-xs) var(--p-md);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    color: var(--dark-gray);
    font-weight: 500;
}

.filter-button:hover {
    background-color: rgba(14, 128, 64, 0.1);
    border-color: var(--green);
}

.filter-button.active {
    background-color: var(--green);
    color: var(--white);
    border-color: var(--green);
}

/* Search Results Grid */
.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--p-lg);
    margin-bottom: var(--p-xl);
}

/* Result Card */
.result-card {
    background-color: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    overflow: hidden;
    height: 100%;
    border: 1px solid var(--border-gray);
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
    border-color: var(--green);
}

.result-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.result-image {
    height: 180px;
    overflow: hidden;
    position: relative;
    background-color: var(--light-gray);
}

.result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.result-card:hover .result-image img {
    transform: scale(1.05);
}

.placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--medium-gray);
    background-color: var(--light-gray);
}

.result-content {
    padding: var(--p-md);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Badge styles */
.result-type {
    display: inline-block;
    border-radius: 20px;
    padding: var(--p-xs) var(--p-sm);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: var(--p-sm);
    background-color: transparent;
    border: 1px solid;
}

.result-title {
    font-size: 1.2rem;
    margin-bottom: var(--p-sm);
    color: var(--dark-gray);
    line-height: 1.4;
    font-weight: 500;
}

.result-description {
    color: var(--medium-gray);
    font-size: 0.9rem;
    margin-bottom: var(--p-md);
    line-height: 1.5;
    flex-grow: 1;
}

.result-meta {
    display: flex;
    gap: var(--p-md);
    margin-bottom: var(--p-sm);
    font-size: 0.85rem;
    color: var(--medium-gray);
}

.result-link {
    display: inline-block;
    color: var(--green);
    text-decoration: none;
    font-weight: 500;
    margin-top: auto;
    transition: all 0.3s ease;
}

.result-link:hover {
    color: var(--dark-green);
}

/* Type-specific styles */
.result-card[data-type="Député"] .result-type {
    color: var(--green);
    border-color: var(--green);
}

.result-card[data-type="Groupe Parlementaire"] .result-type {
    color: var(--red);
    border-color: var(--red);
}

.result-card[data-type="Groupe d'Amitié"] .result-type {
    color: var(--gold);
    border-color: var(--gold);
}

.result-card[data-type="Commission"] .result-type {
    color: var(--green);
    border-color: var(--green);
}

.result-card[data-type="Article"] .result-type {
    color: var(--medium-gray);
    border-color: var(--medium-gray);
}

.result-card[data-type="Texte Législatif"] .result-type {
    color: var(--gold);
    border-color: var(--gold);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: var(--p-xs);
    margin-top: var(--p-xl);
}

.pagination-link {
    display: inline-block;
    padding: var(--p-xs) var(--p-sm);
    background-color: var(--white);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-sm);
    color: var(--dark-gray);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.pagination-link:hover {
    background-color: var(--light-gray);
}

.pagination-link.active {
    background-color: var(--green);
    color: var(--white);
    border-color: var(--green);
}

/* No Results */
.no-results {
    text-align: center;
    padding: var(--p-xl) var(--p-md);
    background-color: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-light);
    margin: var(--p-xl) auto;
    max-width: 600px;
}

.no-results-icon {
    font-size: 4rem;
    color: var(--border-gray);
    margin-bottom: var(--p-md);
}

.no-results h2 {
    font-size: 1.8rem;
    color: var(--dark-gray);
    margin-bottom: var(--p-sm);
    font-weight: 500;
}

.no-results p {
    color: var(--medium-gray);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .search-header {
        padding: var(--p-lg) 0 var(--p-md);
    }

    .search-header h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .search-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: var(--p-md);
    }

    .search-header {
        padding: var(--p-md) 0;
    }

    .search-header h1 {
        font-size: 1.5rem;
    }

    .filter-buttons {
        overflow-x: auto;
        padding-bottom: var(--p-xs);
        justify-content: flex-start;
    }
}

@media (max-width: 576px) {
    .search-results-grid {
        grid-template-columns: 1fr;
    }

    .result-image {
        height: 160px;
    }

    .search-header {
        padding: var(--p-md) 0 var(--p-sm);
    }
}