/* Textes Législatifs Page Styles */

:root {
    --green: #0E8040;
    --dark-green: #0A6030;
    --red: #ED2024;
    --white: #FFFFFF;
    --dark-gray: #333333;
    --medium-gray: #666666;
    --light-gray: #F5F5F5;
    --border-gray: #E0E0E0;
}

/* Filters Section */
.filters-section {
    background: var(--light-gray);
    padding: 4rem 0 2rem 0;
    /* Add top padding to account for overlapping tabs */
    border-bottom: 1px solid var(--border-gray);
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.results-count {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-gray);
}

.filters-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--medium-gray);
}

.form-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--white);
    color: var(--dark-gray);
    min-width: 150px;
}

/* Textes List Container */
.textes-list-container {
    padding: 4rem 0;
    background: var(--white);
}

/* Texte Card - New Two Column Layout */
.texte-card {
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0px 4px 70px 0px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid var(--border-gray);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 3rem;
    box-sizing: border-box; /* Ensure padding doesn't cause overflow */
}

.texte-card *, .texte-card *::before, .texte-card *::after {
    box-sizing: border-box;
}

.texte-card:hover {
    transform: translateY(-3px);
    box-shadow: 0px 8px 90px 0px rgba(0, 0, 0, 0.1);
}

.texte-content-left {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.texte-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-gray);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.texte-title a {
    color: var(--dark-gray);
    text-decoration: none;
    transition: color 0.3s ease;
}

.texte-title a:hover {
    color: var(--green);
}

.texte-description {
    color: var(--medium-gray);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Meta Information Stack */
.texte-meta-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.icon-red {
    color: var(--red);
    width: 20px; /* Fixed width for alignment */
    text-align: center;
}

.meta-label {
    color: var(--dark-gray);
    font-weight: 600;
    min-width: 100px; /* Optional: align values */
}

.meta-value {
    color: var(--dark-gray);
}

/* Action Buttons Column */
.texte-actions-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 220px;
    flex-shrink: 0;
    justify-content: flex-start; /* Align to top instead of center */
    padding-top: 0; /* Remove top padding to align with title */
}

.btn-action {
    padding: 0.75rem 1.5rem;
    border-radius: 8px; /* Slightly less rounded than before to match image */
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Text left, Icon right */
    gap: 0.5rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    width: 100%;
    box-sizing: border-box; /* Crucial for width: 100% */
}

.btn-action.primary {
    background: var(--green);
    color: var(--white);
}

.btn-action.primary:hover {
    background: var(--dark-green);
    transform: translateY(-2px);
}

.btn-action.secondary {
    background: transparent;
    color: var(--green);
    border-color: var(--green);
}

.btn-action.secondary:hover {
    background: var(--green);
    color: var(--white);
}

/* Responsive Design for Card */
@media (max-width: 768px) {
    .texte-card {
        flex-direction: column;
        gap: 1.5rem;
    }

    .texte-actions-right {
        width: 100%;
        min-width: unset;
        flex-direction: row; /* Stack horizontally on mobile? or vertical still? Let's keep vertical for consistency or auto */
        flex-wrap: wrap;
    }
    
    .btn-action {
        justify-content: center;
    }
}

/* Pagination */
.pagination-container {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-item {
    display: inline-block;
}

.page-link {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    color: var(--dark-gray);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
}

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

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

/* Empty State */
.alert {
    padding: 3rem;
    border-radius: 15px;
    text-align: center;
}

.alert-info {
    background: var(--light-gray);
    border: 1px solid var(--border-gray);
}

/* Responsive Design */
@media (max-width: 768px) {
    .filters-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters-controls {
        width: 100%;
    }

    .filter-group {
        flex: 1;
        min-width: 120px;
    }

    .texte-card {
        padding: 1.5rem;
    }

    .texte-title {
        font-size: 1.25rem;
    }

    .texte-actions {
        flex-direction: column;
    }

    .btn-action {
        width: 100%;
        justify-content: center;
    }
}


/* Custom Card Tabs matching design */
.textes-tabs-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 3rem;
    flex-wrap: wrap;
    padding: 0 1rem;
    position: relative;
    z-index: 10;
    margin-bottom: -20px;
    /* Slight overlap to sit exactly on the edge */
}

/* We need to correct the page-hero expectation. */
.page-hero {
    padding-bottom: 0 !important;
    /* Remove padding so tabs sit at bottom */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.page-hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding-bottom: 20px;
    /* Space inside the content before the edge */
}

.textes-tab {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 15px;
    gap: 8px;
    
    width: 160px;
    height: 90px;
    
    background: rgba(255, 255, 255, 0.3);
    box-shadow: inset 0px -4px 15px rgba(0, 0, 0, 0.35);
    border-radius: 20px 20px 0px 0px;
    
    /* Interactive props */
    text-decoration: none;
    transition: all 0.3s ease;
    border: none; /* Removing previous border */
    backdrop-filter: blur(4px); /* Keeping some blur might be nice, but following spec primarily */
}

.textes-tab:hover {
    background: rgba(255, 255, 255, 0.45);
    transform: translateY(-2px);
    text-decoration: none;
}

.tab-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
}

.tab-icon svg {
    width: 40px;
    height: 40px;
    fill: currentColor;
}

.tab-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--white);
    text-align: center;
    line-height: 1.2;
    text-transform: none;
    /* Design shows normal case mostly, but let's check */
}

/* Active State */
.textes-tab.active {
    background: var(--white);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
    border-color: var(--white);
}

.textes-tab.active .tab-icon {
    color: var(--red);
}

.textes-tab.active .tab-label {
    color: var(--dark-gray);
    font-weight: 700;
}

/* Specific styling for the icons if needed */
.textes-tab i {
    transition: color 0.3s ease;
}

/* Responsive adjustment */
@media (max-width: 992px) {
    .textes-tabs-container {
        gap: 0.5rem;
        margin-top: 2rem;
    }

    .textes-tab {
        width: 120px;
        height: 100px;
        padding: 0.75rem;
    }

    .tab-icon {
        font-size: 1.5rem;
        height: 30px;
        margin-bottom: 0.5rem;
    }

    .tab-icon svg {
        width: 30px;
        height: 30px;
    }

    .tab-label {
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .textes-tabs-container {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 1rem;
        flex-wrap: nowrap;
        justify-content: flex-start;
        /* Reset justify content for scroll */
        -webkit-overflow-scrolling: touch;
    }

    .textes-tab {
        flex: 0 0 auto;
        /* Don't shrink */
    }
}