/* 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;
}

/* Archive Search Input */
.archive-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.archive-search-input {
    padding: 0.5rem 2.2rem 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: 180px;
    height: auto;
    line-height: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.archive-search-input:focus {
    border-color: var(--green);
}

.archive-search-btn {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--medium-gray);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.85rem;
}

.archive-search-btn:hover {
    color: var(--green);
}

/* 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: 0.5rem;
        flex-wrap: nowrap;
        gap: 0.5rem;
        margin-top: 1.5rem;
        margin-bottom: -10px;
        padding: 0 1rem 0.5rem 1rem;
        width: 100%;
        box-sizing: border-box;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin; /* Firefox - thin scrollbar */
        scrollbar-color: rgba(255,255,255,0.4) transparent; /* Firefox - thumb & track */
    }

    .textes-tabs-container::-webkit-scrollbar {
        height: 3px; /* Thin scrollbar for Chrome/Safari */
    }

    .textes-tabs-container::-webkit-scrollbar-track {
        background: transparent;
    }

    .textes-tabs-container::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.4);
        border-radius: 3px;
    }

    .textes-tab {
        flex: 0 0 auto;
        flex-direction: row;
        width: auto;
        height: auto;
        padding: 0.5rem 1rem;
        border-radius: 20px;
        gap: 0;
        background: rgba(255, 255, 255, 0.2);
        box-shadow: none;
        border: 1px solid rgba(255, 255, 255, 0.3);
    }

    .textes-tab .tab-icon {
        display: none;
    }

    .textes-tab .tab-label {
        font-size: 0.8rem;
        font-weight: 500;
        white-space: nowrap;
    }

    .textes-tab.active {
        background: var(--white);
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

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

    .textes-tab:hover {
        transform: none;
    }
}

/* ===== Archive Table ===== */
.archive-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    border: 1px solid var(--border-gray);
}

.archive-table thead th {
    padding: 0.85rem 1rem;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    color: var(--dark-gray);
    background: var(--light-gray);
    border-bottom: 2px solid var(--border-gray);
    border-right: 1px solid var(--border-gray);
}

.archive-table thead th:last-child {
    border-right: none;
}

.archive-table tbody tr {
    border-bottom: 1px solid var(--border-gray);
    transition: background 0.15s ease;
}

.archive-table tbody tr:hover {
    background: #fafafa;
}

.archive-table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    color: var(--dark-gray);
    border-right: 1px solid var(--border-gray);
}

.archive-table tbody td:last-child {
    border-right: none;
}

.archive-numero {
    font-weight: 600;
    white-space: nowrap;
    width: 110px;
}

.archive-titre {
    line-height: 1.4;
    width: 45%;
}

.archive-titre a {
    color: var(--dark-gray);
    text-decoration: none;
    transition: color 0.2s ease;
}

.archive-titre a:hover {
    color: var(--green);
    text-decoration: underline;
}

.archive-categorie,
.archive-annee {
    white-space: nowrap;
    width: 100px;
}

.archive-fichiers {
    white-space: normal;
    width: 120px;
    text-align: left;
}

.archive-pdf-link {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    color: var(--red);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: background 0.15s ease;
    margin: 0 0.15rem;
}

.archive-pdf-link i {
    font-size: 1rem;
}

.archive-pdf-link:hover {
    background: rgba(237, 32, 36, 0.1);
    color: var(--red);
}

/* Archive table responsive */
@media (max-width: 768px) {
    .archive-table thead {
        display: none;
    }

    .archive-table tbody tr {
        display: block;
        padding: 1rem;
        margin-bottom: 0.5rem;
        border: 1px solid var(--border-gray);
        border-radius: 8px;
    }

    .archive-table tbody td {
        display: block;
        width: 100%;
        padding: 0.25rem 0;
    }

    .archive-table tbody td.archive-numero {
        font-size: 0.85rem;
        color: var(--medium-gray);
    }

    .archive-table tbody td.archive-titre {
        font-weight: 600;
        margin-bottom: 0.5rem;
    }

    .archive-fichiers {
        width: 100%;
    }
}