
:root {
    --primary-color: #0f172a;
    --primary-light: #1e293b;
    --accent-color: #10b981;
    --bg-color: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-lg: 1rem;
    --radius-md: 0.75rem;
    --android-gradient: linear-gradient(135deg, #0f172a 0%, #10b981 100%);
}

html, body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
}

a {
    text-decoration: none !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* Hero Section */
.hero-section {
    padding: 100px 0 60px;
    background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.05), transparent),
                radial-gradient(circle at bottom left, rgba(15, 23, 42, 0.03), transparent);
}

.search-box {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.search-box:hover, .search-box:focus-within {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    border-color: rgba(16, 185, 129, 0.2);
}

.search-input {
    border: none;
    padding: 12px 20px;
    font-size: 1.1rem;
    width: 100%;
    outline: none;
}

.btn-search {
    background: var(--primary-color);
    color: var(--white);
    border-radius: var(--radius-md);
    padding: 12px 30px;
    font-weight: 600;
    border: none;
    transition: all 0.3s ease;
}

.btn-search:hover {
    background: var(--accent-color);
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3);
}

/* Navigation */
.navbar-custom {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
    padding: 12px 0;
    transition: all 0.3s ease;
}

.nav-link-custom {
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0 10px;
    padding: 8px 16px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link-custom i {
    font-size: 1rem;
    opacity: 0.7;
    transition: transform 0.3s ease;
}

.nav-link-custom:hover {
    color: var(--primary-color);
    background: rgba(16, 185, 129, 0.05);
}

.nav-link-custom:hover i {
    transform: translateY(-2px);
    opacity: 1;
}

.nav-link-custom.active {
    color: var(--white);
    background: var(--primary-color);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.nav-link-custom.active i {
    opacity: 1;
    color: var(--accent-color);
}

/* Glassmorphism extra for navbar brand */
.navbar-brand {
    font-size: 1.4rem;
    letter-spacing: -0.5px;
}


/* Bottom Navigation for Mobile */
@media (max-width: 991px) {
    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70px;
        background: var(--white);
        box-shadow: 0 -5px 15px rgba(0,0,0,0.05);
        display: flex;
        justify-content: space-around;
        align-items: center;
        z-index: 1000;
        padding-bottom: env(safe-area-inset-bottom);
        border-top: 1px solid rgba(226, 232, 240, 1);
    }
    .bottom-nav-item {
        text-align: center;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 0.75rem;
    }
    .bottom-nav-item i {
        font-size: 1.25rem;
        display: block;
        margin-bottom: 4px;
    }
    .bottom-nav-item.active {
        color: var(--accent-color);
    }
    body { padding-bottom: 80px; }
    .hero-section { padding-top: 60px; }
}

/* News Cards */
.news-card {
    position: relative; /* CRITICAL for stretched-link */
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease;
    border: 1px solid rgba(226, 232, 240, 0.5);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: scale(1.02);
}

.news-img {
    height: 200px;
    object-fit: contain;
    width: 100%;
    background-color: rgba(15, 23, 42, 0.03);
}

.news-content {
    padding: 1.5rem;
}

/* Badges */
.badge-custom {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
}

.badge-admis { background: rgba(16, 185, 129, 0.1); color: #059669; }
.badge-admissible { background: rgba(234, 179, 8, 0.1); color: #ca8a04; }
.badge-echoue { background: rgba(239, 68, 68, 0.1); color: #dc2626; }

/* Android Smart Banner */
.android-banner {
    background: var(--android-gradient);
    padding: 10px 0;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    z-index: 2000;
    position: relative;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.android-banner .btn-light {
    color: var(--primary-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: none;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.android-banner .btn-light:hover {
    transform: scale(1.05);
    background: #ffffff;
}

/* Utilities line-clamping */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;  
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;  
    overflow: hidden;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

/* Accent Utilities */
.text-accent {
    color: var(--accent-color) !important;
}
.border-accent {
    border-color: var(--accent-color) !important;
}

/* Pro Shadow */
.shadow-pro {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.shadow-pro:hover {
    box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.15), 0 15px 20px -6px rgba(0, 0, 0, 0.05) !important;
    transform: translateY(-3px);
}

.badge-elevated {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    color: var(--primary-color) !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
}

/* Mobile Optimizations (Pro Max) */
@media (max-width: 767.98px) {
    /* Hero section padding reduction */
    .hero-section {
        padding: 60px 0 30px;
    }
    
    /* Search box compactness */
    .search-box {
        padding: 0.75rem;
        border-radius: var(--radius-md);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    }
    .search-input {
        padding: 10px 15px;
        font-size: 1rem;
    }
    .search-box i.fa-search {
        margin-left: 1rem !important; /* adjust absolute icon */
    }

    /* Cards typography and layout */
    .news-content, .concours-card-body, .result-card {
        padding: 1rem;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h5 { font-size: 1.1rem; }
    
    /* Touch Targets for Pagination */
    .pagination {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px; /* space for scrollbar */
        justify-content: flex-start !important;
    }
    .page-link {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
    }
    
    /* General Spacing */
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    .mb-5 {
        margin-bottom: 1.5rem !important;
    }
}