/* ============================================================
   layouts.css — Grilles, Containers, Sidebar (BADEL)
   ============================================================ */

/* ════════════════════════════════════════
   LAYOUT PRINCIPAL DES PAGES
   ════════════════════════════════════════ */
.page-container {
    display: flex;
    gap: 25px;
    padding: 20px; /* Padding réduit pour utiliser plus d'espace */
    padding-top: 25px;
    width: 100%;
    max-width: 100vw; /* Utilise toute la largeur disponible, limité à viewport */
    margin: 0;
    align-items: flex-start;
}

.main-content {
    flex: 1;
    min-width: 0; /* Prevents flex items from overflowing */
    max-width: 100%;
}

/* ════════════════════════════════════════
   SIDEBAR FILTRE (badel.html)
   ════════════════════════════════════════ */
.filter-sidebar {
    width: var(--filter-width);
    flex-shrink: 0;
    position: sticky; 
    top: 95px; /* Sit right below the header */
    align-self: flex-start;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: 0 10px 40px rgba(17, 40, 54, 0.08);
    display: flex;
    flex-direction: column;
    z-index: var(--z-sidebar);
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    border: 1px solid rgba(0, 255, 132, 0.1);
}

.sidebar-header {
    margin-bottom: 15px;
    text-align: center;
    position: relative;
}

.close-sidebar {
    display: none;
}

.sidebar-header h2 {
    color: var(--primary-dark);
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-green);
}

.filter-tabs {
    display: flex;
    background: #f8fdfb;
    padding: 5px;
    border-radius: 14px;
    gap: 5px;
    margin: 20px 0;
}

.filter-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 10px;
    transition: var(--transition);
}

.filter-tab.active {
    background: var(--accent-green);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(0, 255, 132, 0.3);
}

.sidebar-scroll {
    overflow-y: auto;
    flex: 1;
    padding-right: 5px;
}

.sidebar-scroll::-webkit-scrollbar {
    width: 4px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    background: var(--accent-green-2);
    border-radius: 10px;
}

.filter-content {
    display: none;
}

.filter-content.active {
    display: block;
}

.filter-section {
    background: var(--white);
    border: 1px solid #eef6f2;
    border-radius: 18px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.filter-section h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-section h3 i {
    color: var(--accent-green-2);
}

.filter-section select,
.filter-input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 12px;
    border: 1.5px solid #eef2f0;
    background: #f8fdfb;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    color: var(--primary-dark);
    outline: none;
    transition: var(--transition);
}

.filter-section select:focus,
.filter-input:focus {
    border-color: var(--accent-green);
    background: var(--white);
}

.apply-filter-btn {
    background: var(--accent-green);
    color: var(--primary-dark);
    border: none;
    padding: 16px;
    border-radius: 15px;
    font-weight: 800;
    font-size: 1.1rem;
    width: 100%;
    margin-top: 10px;
    box-shadow: 0 8px 20px rgba(0, 255, 132, 0.25);
    transition: var(--transition);
}

.apply-filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 255, 132, 0.35);
}

.apply-filter-btn:active {
    transform: translateY(0);
}

/* ════════════════════════════════════════
   ANNONCES WRAPPER (badel.html)
   ════════════════════════════════════════ */
.annonces-wrapper {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-top: 0; /* Same level as sidebar filter */
}

.annonces-wrapper h2 {
    color: var(--primary-dark);
    border-bottom: 2px solid var(--accent-green);
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.annonces-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    align-items: start;
}

/* ════════════════════════════════════════
   SIDEBAR TRANSACTIONS (profil.html)
   ════════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
}

/* ════════════════════════════════════════
   SECTION TITLE
   ════════════════════════════════════════ */
.section-title {
    color: var(--primary-dark);
    text-align: center;
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-green);
    position: relative;
}

/* ════════════════════════════════════════
   TABS (shared)
   ════════════════════════════════════════ */
.transaction-tabs,
.filter-tabs {
    display: flex;
    gap: 5px;
    background: #f5fcf9;
    border-radius: 10px;
    padding: 5px;
    margin-bottom: 20px;
}

.tab {
    flex: 1;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 600;
    color: #556f7c;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: var(--transition-normal);
    border-radius: var(--border-radius-sm);
    text-align: center;
    font-size: 0.85rem;
}

.tab.active {
    color: var(--white);
    background: linear-gradient(135deg, var(--accent-green), var(--accent-green-2));
    box-shadow: 0 4px 8px rgba(0, 255, 132, 0.3);
}

/* ════════════════════════════════════════
   NOTIFICATION BADGE (NavBar/Footer)
   ════════════════════════════════════════ */
.footer-icon, .nav-btn, .nav-link {
    position: relative !important;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 11px;
    height: 11px;
    background: #ef4444;
    border: 2px solid white;
    border-radius: 50%;
    z-index: 999;
    pointer-events: none;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1.2); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}