/* ========================================
   Bac.TeX - Modern Design CSS
   ======================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&display=swap');

/* Variables */
:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #7c3aed;
    --accent: #06b6d4;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --sidebar-bg: #1e293b;
    --sidebar-bg-dark: #0f172a;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.45;
}

/* Layout Container */
.container {
    display: grid;
    grid-template-columns: 200px 1fr;
    min-height: 100vh;
    max-width: 1600px;
    margin: 0 auto;
}

/* ========================================
   SIDEBAR
   ======================================== */

.sidebar {
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, var(--sidebar-bg-dark) 100%);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.logo {
    text-align: center;
    padding: 0 1rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 0.75rem;
}

.logo a {
    text-decoration: none;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s;
}

.logo:hover h1 {
    transform: scale(1.08);
    filter: brightness(1.2);
}

/* Navigation */
.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-section {
    margin-bottom: 0.5rem;
}

.nav-section-title {
    padding: 0.4rem 1rem 0.3rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #cbd5e1;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-section-title:hover {
    color: #e2e8f0;
}

.nav-section-title::after {
    content: '▼';
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.nav-section.collapsed .nav-section-title::after {
    transform: rotate(-90deg);
}

.nav-section.collapsed .nav-section-links {
    display: none;
}

.nav-link {
    display: block;
    padding: 0.45rem 1rem;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-size: 0.85rem;
}

.nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: white;
    border-left-color: var(--accent);
}

.nav-link.active {
    background: rgba(96,165,250,0.1);
    color: white;
    border-left-color: var(--primary);
    font-weight: 500;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    margin-left: 0.5rem;
    font-size: 0.65rem;
    border-radius: 10px;
    background: var(--success);
    color: white;
    font-weight: 600;
}

.badge.in-progress {
    background: var(--warning);
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.main-content {
    padding: 3rem;
    overflow-x: hidden;
    background: var(--bg-main);
}

.content-wrapper {
    max-width: 1200px;
}

/* Headings */
h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary);
}

h3 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 2rem 0 1.5rem;
}

h4 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary);
    margin: 2rem 0 1rem;
    padding-left: 1rem;
    border-left: 4px solid var(--primary);
}

/* Paragraphs */
p {
    margin-bottom: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

p[align="justify"] {
    text-align: justify;
}

p[align="center"] {
    text-align: center;
}

p[align="right"] {
    text-align: right;
}

/* Links in content */
.pstylelink {
    background: var(--bg-card);
    padding: 0.875rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.pstylelink a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.pstylelink a:hover {
    background: var(--primary);
    color: white;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

center img {
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    margin: 1rem 0;
    transition: transform 0.3s, box-shadow 0.3s;
}

center img:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.2);
}

/* Lists */
ul {
    margin: 1rem 0;
    padding-left: 2rem;
}

li {
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* Code and Technical text */
tt, code {
    background: #f1f5f9;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--primary-dark);
    font-weight: 500;
}

/* Horizontal Rule */
hr {
    border: none;
    border-top: 2px solid var(--border);
    margin: 3rem 0;
}

/* Font colors */
font[color="#CE3C1D"],
font[color="35d1ff"] {
    font-weight: 600;
}

/* News section styling */
.news-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-bottom: 1rem;
    transition: all 0.3s;
    border-left: 4px solid var(--primary);
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    border-left-color: var(--accent);
}

.news-date {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.news-content {
    color: var(--text-secondary);
    line-height: 1.6;
}

.news-thanks {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    opacity: 0.8;
}

/* Banner style for important info */
.banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 2rem;
    border-radius: 12px;
    color: white;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(37,99,235,0.2);
}

.banner h3 {
    color: white;
    margin: 0 0 1rem 0;
    padding: 0;
    border: none;
    font-size: 1.6rem;
}

.banner p {
    color: white;
    opacity: 0.95;
}

/* Info box */
.info-box {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 4px solid var(--primary);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.info-box p {
    color: var(--text-secondary);
}

/* Footer */
.footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer p {
    margin-bottom: 0.5rem;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ========================================
   TABLE DES CODES (sujetsorig.php)
   ======================================== */

.codes-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 2rem 0;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 2px solid #cbd5e1;
}

.codes-table thead tr {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.codes-table th {
    padding: 1rem;
    text-align: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    border: 2px solid rgba(255,255,255,0.3);
}

.codes-table tbody tr td {
    padding: 1.5rem 1rem;
    border: 2px solid #cbd5e1;
    vertical-align: top;
    background: white;
}

.codes-table .codes-cell {
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.75;
    text-align: left;
    padding-top: 1rem !important;
}

.codes-table .codes-cell a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: all 0.2s;
    display: inline-block;
}

.codes-table .codes-cell a:hover {
    background: var(--primary);
    color: white;
    transform: translateX(2px);
}

.codes-table tfoot tr {
    background: #f8fafc;
}

.codes-table .zip-cell {
    text-align: center;
    padding: 1rem;
    border: 2px solid #cbd5e1;
}

.codes-table .zip-cell a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background: white;
    border: 2px solid var(--primary);
    display: inline-block;
    transition: all 0.2s;
}

.codes-table .zip-cell a:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* Grille des régions */
.regions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.8rem;
    margin-top: 1rem;
}

.region-item {
    padding: 0.5rem 0.8rem;
    background: white;
    border-radius: 6px;
    border-left: 3px solid var(--primary);
    font-size: 0.9rem;
}

.region-item tt {
    color: var(--primary);
    font-weight: 600;
    background: transparent;
    padding: 0;
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* ========================================
   PACKAGES SECTION
   ======================================== */

/* Grille des catégories de packages */
.packages-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.package-category {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.3s;
    text-align: center;
}

.package-category:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.package-category.graphiques {
    border-top: 4px solid #007BFF;
}

.package-category.jeux {
    border-top: 4px solid #dc3545;
}

.package-category.maths {
    border-top: 4px solid #28a745;
}

.package-category.outils {
    border-top: 4px solid #6f42c1;
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.package-category.graphiques .category-icon {
    color: #007BFF;
}

.package-category.jeux .category-icon {
    color: #dc3545;
}

.package-category.maths .category-icon {
    color: #28a745;
}

.package-category.outils .category-icon {
    color: #6f42c1;
}

.package-category h3 {
    font-size: 1.5rem;
    margin: 1rem 0;
    color: var(--text-primary);
}

.package-category p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.category-stats {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.category-link {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.category-link:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Grille des packages */
.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.package-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.3s;
    text-align: center;
}

.package-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.package-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.package-card h4 {
    font-size: 1.1rem;
    margin: 0.5rem 0;
    color: var(--text-primary);
    border: none;
    padding: 0;
}

.package-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.package-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #007BFF;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.package-btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

.package-btn.jeux {
    background: #dc3545;
}

.package-btn.jeux:hover {
    background: #b02a37;
}

.package-btn.maths {
    background: #28a745;
}

.package-btn.maths:hover {
    background: #218838;
}

.package-btn.outils {
    background: #6f42c1;
}

.package-btn.outils:hover {
    background: #5a32a3;
}

/* Détail d'un package */
.package-detail-header {
    margin-bottom: 2rem;
}

.package-breadcrumb {
    margin-bottom: 1.5rem;
}

.package-breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.package-breadcrumb a:hover {
    color: var(--primary-dark);
    transform: translateX(-2px);
}

.package-title-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.package-icon-large {
    font-size: 2.5rem;
}

.package-title-section h2 {
    margin: 0;
    border: none;
    padding: 0;
}

.package-actions-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: white;
    color: var(--primary);
    text-decoration: none;
    border: 2px solid var(--primary);
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.action-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* Liste des fichiers */
.package-files-list {
    margin: 2rem 0;
}

.file-item {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
}

.file-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateX(4px);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.file-icon-small {
    font-size: 2rem;
}

.file-details {
    flex: 1;
}

.file-name-text {
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.file-type {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 500;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

.file-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: white;
    color: var(--primary);
    text-decoration: none;
    border: 2px solid var(--primary);
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.9rem;
    white-space: nowrap;
}

.file-action-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2);
}

/* Responsive pour les fichiers */
@media (max-width: 768px) {
    .file-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .file-actions {
        width: 100%;
    }
    
    .file-action-btn {
        flex: 1;
        justify-content: center;
    }
}

.package-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

@media (max-width: 1200px) {
    .codes-table {
        font-size: 0.85rem;
    }
    
    .codes-table th {
        font-size: 1rem;
        padding: 0.8rem 0.5rem;
    }
    
    .codes-table td {
        padding: 1rem 0.5rem;
    }
}

@media (max-width: 968px) {
    .container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        max-height: none;
    }

    .main-content {
        padding: 2rem 1.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    h4 {
        font-size: 1.2rem;
    }
    
    .codes-table {
        display: block;
        overflow-x: auto;
    }
    
    .regions-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 640px) {
    .main-content {
        padding: 1.5rem 1rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    .pstylelink {
        padding: 1rem;
        font-size: 0.9rem;
    }

    .logo h1 {
        font-size: 1.5rem;
    }
    
    .regions-grid {
        grid-template-columns: 1fr;
    }
}

.button-link {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 1rem;
	background: var(--primary);
	color: white;
	text-decoration: none;
	border-radius: 8px;
	font-weight: 500;
	transition: all 0.2s;
	border: none;
	font-size: 0.95rem;
}

.button-link:hover {
	background: var(--primary-dark);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.button-link.secondary {
	background: var(--accent);
}

.button-link.secondary:hover {
	background: #0891b2;
}

.button-link.tertiary {
	background: var(--secondary);
}

.button-link.tertiary:hover {
	background: #6d28d9;
}

.monospace {
  font-family: 'Consolas', 'Fira Code', 'Monaco', 'Courier New', monospace;
  background: none;
  padding: 0;
  margin: 0;
  border: none;
}

.img-container {
  display: flex;
  align-items: center; /* Aligne les éléments verticalement au centre */
  justify-content: center; /* Centre les éléments horizontalement */
  gap: 10px; /* Espacement entre les éléments */
}

.img-vertical-line {
  height: 100px; /* Ajustez la hauteur selon vos besoins */
  width: 2px;
  background-color: #000; /* Couleur de la ligne */
  margin: 0 10px; /* Espacement autour de la ligne */
}