/**
 * 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);
    --p-xs: 0.5rem;
    --p-sm: 0.75rem;
    --p-md: 1rem;
    --p-lg: 1.5rem;
    --p-xl: 2rem;
}

/* Search Container */
.search-container {
    min-height: 70vh;
    width: 100%;
    max-width: 100%;
    border-left: none !important;
    position: relative;
}

.search-container::before {
    display: none !important;
}

/* Only override the green line on the left side, not the red line under the menu */
.search-container .main-menu,
.search-container nav.main-menu {
    border-left: none !important;
}

/* Override the green line on the left side of the search header h1 */
.search-header h1::after {
    display: none !important;
}

/* Make sure there's no green line on the left side of any element */
.search-container *::before,
.search-container *::after {
    border-left: none !important;
}

/* Add a specific rule to remove any green line on the left */
.green-line {
    display: none !important;
}

/* Search Header */
.search-header {
    padding: var(--p-xl) 0 var(--p-lg);
    margin-bottom: var(--p-lg);
    border-bottom: 1px solid #eee;
    position: relative;
    border-left: none !important;
}

.search-header::before {
    display: none !important;
}


.search-title {
    font-size: 2rem;
    margin: 0 auto var(--p-md);
    color: var(--dark-gray);
    text-align: center;
    position: relative;
    padding-bottom: var(--p-sm);
    display: block;
    max-width: 90%;
}



.search-title::before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 1px;
    background: linear-gradient(to right, var(--white), var(--red), var(--green));
}

.search-stats {
    text-align: center;
    margin-bottom: var(--p-lg);
    color: var(--medium-gray);
}

/* Search Filters */
.search-filters {
    margin-bottom: var(--p-lg);
    border-bottom: 1px solid var(--border-gray);
    padding-bottom: var(--p-md);
    text-align: center;
}

.filter-label {
    font-weight: 500;
    margin-bottom: var(--p-xs);
    color: var(--dark-gray);
    text-align: center;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: var(--p-xs);
    justify-content: center;
}

.filter-option {
    display: inline-block;
    padding: var(--p-xs) var(--p-md);
    border: 1px solid var(--border-gray);
    border-radius: 20px;
    color: var(--dark-gray);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    margin: 0 5px 5px 0;
}

.filter-option:hover {
    border-color: var(--green);
    color: var(--green);
}

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

/* Search Results Section */
.search-results-section {
    padding: var(--p-md) 0 var(--p-xl);
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin: 0 auto 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: contain;
    transition: all 0.3s ease;
    background-color: var(--light-gray);
}

/* Special styling for deputy images */
.result-card[data-type="Député"] .result-image {
    height: 200px;
}

.result-card[data-type="Député"] .result-image img {
    object-fit: contain;
    padding: 5px;
}

.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);
}

.placeholder-image i {
    font-size: 3rem;
    opacity: 0.5;
}

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

/* Badge styles */
.result-type {
    display: block;
    border-radius: 20px;
    padding: var(--p-xs) var(--p-sm);
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0 auto var(--p-sm);
    background-color: transparent;
    border: 1px solid;
    text-align: center;
    width: fit-content;
}

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

.result-title a {
    color: var(--green);
    text-decoration: none;
    transition: color 0.3s ease;
}

.result-title a:hover {
    color: var(--dark-green);
    text-decoration: none;
}

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

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

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

.result-link:hover {
    color: var(--dark-green);
    transform: translateY(2px);
}

/* 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(--dark-green);
    border-color: var(--dark-green);
}

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

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

.result-card[data-type="Archive Texte"] .result-type {
    color: #8B6914;
    border-color: #8B6914;
}

/* Search Form */
.search-form-large {
    max-width: 700px;
    margin: var(--p-xl) auto;
}

.search-input-container {
    position: relative;
    margin-bottom: var(--p-lg);
}

.search-input-large {
    width: 100%;
    padding: 15px 60px 15px 20px;
    font-size: 1.2rem;
    border: 2px solid var(--border-gray);
    border-radius: var(--radius-md);
    transition: border-color 0.3s;
}

.search-input-large:focus {
    border-color: var(--green);
    outline: none;
}

.search-submit-large {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--green);
    color: var(--white);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}

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

/* Search Suggestions */
.search-suggestions {
    text-align: center;
}

.search-suggestions h3 {
    margin-bottom: var(--p-md);
    color: var(--dark-gray);
    font-size: 1.2rem;
}

.suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.suggestion-tag {
    display: inline-block;
    padding: var(--p-xs) var(--p-md);
    background-color: var(--light-gray);
    color: var(--dark-gray);
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.3s;
    border: 1px solid var(--border-gray);
}

.suggestion-tag:hover {
    background-color: var(--green);
    color: var(--white);
    border-color: var(--green);
}

/* No Results */
.no-results {
    background-color: var(--light-gray);
    padding: var(--p-lg);
    border-radius: var(--radius-md);
    margin: var(--p-lg) 0 var(--p-xl);
    text-align: center;
}

.no-results p {
    margin-bottom: var(--p-md);
    color: var(--dark-gray);
}

.no-results ul {
    display: inline-block;
    text-align: left;
    margin: 0 auto;
    color: var(--medium-gray);
}

.no-results li {
    margin-bottom: var(--p-xs);
}

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

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

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

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

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

    .search-title {
        font-size: 1.8rem;
    }

    .search-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

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

    .search-title {
        font-size: 1.5rem;
    }

    .filter-options {
        gap: 8px;
    }

    .filter-option {
        padding: var(--p-xs) var(--p-sm);
        font-size: 0.8rem;
    }

    .search-input-large {
        padding: 12px 50px 12px 15px;
        font-size: 1rem;
    }

    .search-submit-large {
        width: 38px;
        height: 38px;
    }
}

@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);
    }
}
