/* centralisation des styles pour CriloCom */

/* Grilles de services */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.service-card {
    border-radius: 8px;
    padding: 2rem;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border: 2px solid var(--border-color);
    transition: transform 0.2s ease;
}

.service-card:hover {
    transform: translateY(-5px);
}

.service-card h3 {
    margin-top: 0;
    border-bottom: none !important;
}

/* Service Colors Distinction */
.service-strategy { border-top: 4px solid #007bff; }
.service-creation { border-top: 4px solid #28a745; }
.service-marketing { border-top: 4px solid #dc3545; }
.service-ia { border-top: 4px solid #6f42c1; }
.service-formation { border-top: 4px solid #ffc107; }

/* Boutons personnalisés */
.btn-primary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--accent-color);
    color: var(--bg-primary) !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-weight: bold;
}

.cta-center { text-align: center; margin: 3rem 0; }
.cta-left { text-align: left; margin: 3rem 0; }
.cta-right { text-align: right; margin: 3rem 0; }

/* Alertes et encadrés */
.info-box {
    background-color: var(--bg-secondary);
    padding: 2rem;
    border-left: 4px solid var(--accent-color);
    margin: 2rem 0;
}

/* Navigation de bas de page */
.module-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Grille de navigation Accueil */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.nav-card {
    display: block;
    text-align: center;
    padding: 2rem;
    color: white !important;
    text-decoration: none !important;
    border-radius: 8px;
    transition: transform 0.2s;
}

.nav-card:hover {
    transform: translateY(-5px);
}

.nav-card h3 {
    margin: 0;
    color: white !important;
    border-bottom: none !important;
}

.nav-card p {
    margin-top: 0.5rem;
    opacity: 0.9;
}

.bg-service { background-color: #159957; }
.bg-news { background-color: #6f42c1; }
.bg-legal { background-color: #1e6bb8; }

/* Explorateur de ressources */
.explorer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    font-family: Arial, sans-serif;
}

.explorer-section h4 {
    margin-bottom: 1rem;
}

.explorer-list {
    list-style: none;
    padding-left: 0;
}

.explorer-list li {
    margin-bottom: 0.5rem;
}

/* Grilles génériques */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

/* Cartes génériques */
.card {
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 8px;
    background-color: var(--bg-primary);
}

.card-secondary {
    background-color: var(--bg-secondary);
}

.card-shadow {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Gradients */
.gradient-purple { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white !important; }
.gradient-rose { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); color: white !important; }
.gradient-blue { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); color: white !important; }

.gradient-purple h3, .gradient-rose h3, .gradient-blue h3 { color: white !important; border-bottom: none !important; }
.gradient-purple p, .gradient-rose p, .gradient-blue p { color: rgba(255,255,255,0.9) !important; }

/* Alertes */
.alert {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    border-left: 4px solid transparent;
}

/* Light Mode Alerts */
.alert-info { background-color: #d1ecf1; border-left-color: #0c5460; color: #0c5460; }
.alert-success { background-color: #d4edda; border-left-color: #155724; color: #155724; }
.alert-warning { background-color: #fff3cd; border-left-color: #856404; color: #856404; }
.alert-error { background-color: #f8d7da; border-left-color: #721c24; color: #721c24; }

/* Dark Mode Overrides for Alerts */
[data-theme="dark"] .alert-info { background-color: #103035; border-left-color: #4dbfd0; color: #4dbfd0; }
[data-theme="dark"] .alert-success { background-color: #0e3015; border-left-color: #5edb76; color: #5edb76; }
[data-theme="dark"] .alert-warning { background-color: #352a0a; border-left-color: #e6b325; color: #e6b325; }
[data-theme="dark"] .alert-error { background-color: #351014; border-left-color: #e65561; color: #e65561; }

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 4rem 2rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.hero-section h1 { font-size: 3rem; margin-bottom: 1rem; border-bottom: none !important; }
.hero-section p { font-size: 1.3rem; margin-bottom: 2rem; }

/* Blog posts */
.blog-article {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.blog-article h2 {
    border-bottom: none !important;
    margin-bottom: 0.5rem !important;
}

.blog-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 1rem;
}

.tag {
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    font-style: normal;
}

/* Pied de page spécifique au contenu */
.footer-version {
    margin-top: 3rem;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

/* Styles pour la navigation précédente/suivante */
.nav-prev, .nav-next {
    padding: 0.5rem 1rem;
    background-color: var(--bg-secondary);
    color: var(--text-primary) !important;
    text-decoration: none !important;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.nav-prev:hover, .nav-next:hover {
    background-color: var(--accent-color);
    color: var(--bg-primary) !important;
}

/* Formation Specific */
.formation-card {
    text-decoration: none !important;
    color: var(--text-primary) !important;
    transition: transform 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.formation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.formation-thumbnail {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
    margin-bottom: 1rem;
}

/* ==========================================================================
   MOVED FROM DEFAULT.HTML (THEME JOURNAL + DARK MODE + LAYOUT)
   ========================================================================== */

/* ========== VARIABLES CSS ========== */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --border-color: #dee2e6;
  --link-color: #000000;
  --link-hover: #495057;
  --accent-color: #000000;
}

/* Mode Sombre */
[data-theme="dark"] {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --text-primary: #e9ecef;
  --text-secondary: #adb5bd;
  --border-color: #495057;
  --link-color: #f8f9fa;
  --link-hover: #dee2e6;
  --accent-color: #ffffff;
}

/* ========== MASQUAGE FOOTER GITHUB UNIQUEMENT ========== */
.site-footer,
.page-footer {
  display: none !important;
}

/* Afficher le footer personnalisé */
.site-footer-custom {
  display: block !important;
}

/* ========== THÈME JOURNAL ========== */
body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Georgia', 'Times New Roman', serif;
  line-height: 1.8;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.page-header {
  background: var(--bg-primary);
  border-bottom: 3px solid var(--accent-color);
  padding: 2rem 0;
}

.project-name {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 2.5rem;
  letter-spacing: -0.5px;
}

.project-tagline {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-style: italic;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.main-content {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Georgia', 'Times New Roman', serif;
  max-width: 80% !important;
  margin: 0 auto;
}

.page-header {
  background: var(--bg-primary);
  border-bottom: 3px solid var(--accent-color);
  padding: 2rem 10%;
}

.main-content h1,
.main-content h2,
.main-content h3 {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.main-content a {
  color: var(--link-color);
  text-decoration: underline;
  transition: color 0.2s ease;
}

.main-content a:hover {
  color: var(--link-hover);
}

/* ========== FIL D'ARIANE AUTOMATIQUE ========== */
.breadcrumb-auto {
  background-color: var(--bg-secondary);
  padding: 0.75rem 1rem;
  margin-bottom: 2rem;
  border-left: 3px solid var(--accent-color);
  font-family: 'Arial', sans-serif;
  font-size: 0.9rem;
}

.breadcrumb-auto a {
  color: var(--link-color);
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb-auto a:hover {
  text-decoration: underline;
}

.breadcrumb-auto span {
  color: var(--text-secondary);
  margin: 0 0.5rem;
}

/* ========== BOUTON DARK MODE ========== */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: var(--accent-color);
  color: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.theme-toggle:hover {
  transform: scale(1.1);
}

/* ========== BOUTON RETOUR ========== */
.back-button {
  display: inline-block;
  margin-bottom: 1.5rem;
  padding: 0.5rem 1rem;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  text-decoration: none;
  font-family: 'Arial', sans-serif;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.back-button:hover {
  background-color: var(--accent-color);
  color: var(--bg-primary);
}

/* ========== FOOTER PROFESSIONNEL ========== */
.site-footer-custom {
  margin-top: 4rem;
  padding: 2rem 0 1rem;
  border-top: 1px solid var(--border-color);
  font-family: 'Arial', sans-serif;
  font-size: 0.85rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-links {
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--link-color);
  text-decoration: underline;
}

.footer-links .separator {
  color: var(--text-secondary);
  margin: 0 0.75rem;
}

.footer-copyright {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.footer-copyright p {
  margin: 0;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .theme-toggle {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}

/* ==========================================================================
   MOBILE RESPONSIVENESS ENHANCEMENTS
   ========================================================================== */

/* Responsive Tables for Markdown content */
.main-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.5rem;
    border-collapse: collapse;
}

.main-content table th,
.main-content table td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    min-width: 120px; /* Prevent too narrow columns */
}

/* Mobile Adjustments: Wider content (narrower margins) */
@media (max-width: 768px) {
    .main-content {
        max-width: 95% !important;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .page-header {
        padding-left: 2.5% !important;
        padding-right: 2.5% !important;
    }

    .project-name {
        font-size: 2rem; /* Slightly smaller title on mobile */
    }
}

/* ==========================================================================
   V2 UPGRADES (GLASSMORPHISM & VIEW SWITCHER)
   ========================================================================== */

/* Glassmorphism Panels */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
}

[data-theme="dark"] .glass-panel {
    background: rgba(30, 30, 30, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* View Switcher Controls */
.catalog-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 1rem;
}

.view-switcher {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 4px;
    font-weight: bold;
}

.view-btn.active {
    background: var(--accent-color);
    color: var(--bg-primary);
}

.catalog-search input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 250px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* View Modes */
.view-grid {
    /* Uses existing .service-grid or standard grid */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.view-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.view-list .formation-card {
    flex-direction: row;
    height: auto;
    align-items: center;
}

.view-list .formation-thumbnail {
    width: 200px;
    height: 150px;
    margin-bottom: 0;
    margin-right: 2rem;
    border-radius: 8px 0 0 8px;
}

.view-compact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.view-compact .formation-card {
    flex-direction: row;
    padding: 0.5rem 1rem;
    align-items: center;
}

.view-compact .formation-thumbnail {
    display: none;
}

.view-compact h3 {
    margin: 0;
    font-size: 1.1rem;
    margin-right: 1rem;
}

/* Dark Mode Smart Images */
[data-theme="dark"] img.smart-invert {
    filter: invert(1) hue-rotate(180deg);
}

[data-theme="dark"] img:not(.logo) {
    filter: brightness(0.85) contrast(1.1);
    transition: filter 0.3s ease;
}

[data-theme="dark"] input,
[data-theme="dark"] textarea {
    background-color: #ffffff !important;
    color: #000000 !important;
}
