/* RadarNewsAI Main Stylesheet */

/* Définitions globales */
:root {
  --transition-speed: 0.3s;
}

/* Reset de base et layout */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

main {
  flex: 1;
}

/* Structure des conteneurs et rows */
.container {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}

/* Système de grille avec flex pour égaliser les hauteurs naturellement */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
}

.col, .col-md-4, .col-md-6, .col-md-8, .col-md-12, .col-lg-4, .col-lg-6, .col-lg-8, .col-lg-12 {
  position: relative;
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  display: flex;
  margin-bottom: 30px;
}

/* Cartes avec hauteur automatique égalisée via flexbox */
.card {
  display: flex;
  flex-direction: column;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: box-shadow var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.card:hover {
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.card-body {
  flex: 1; /* Permet à la carte de s'étendre pour remplir l'espace */
  padding: 1.5rem;
}

.card-header, .card-footer {
  padding: 1rem 1.5rem;
}

.card-title {
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.card-text {
  margin-bottom: 1rem;
}

/* Navigation */
.navbar {
  padding: 1rem 0;
  margin-bottom: 1.5rem;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
}

.navbar-nav {
  display: flex;
  align-items: center;
}

.nav-item {
  margin-left: 1rem;
}

/* Boutons */
.btn {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

/* Thème Switcher */
.theme-switcher {
  display: flex;
  align-items: center;
}

.theme-btn {
  padding: 0.375rem 0.75rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
  margin-left: 0.5rem;
}

.theme-btn.active {
  font-weight: bold;
}

/* Items d'actualités */
.news-item {
  margin-bottom: 1rem;
}

.news-meta {
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.news-source {
  font-weight: 500;
}

.news-date {
  opacity: 0.7;
}

/* Footer */
footer {
  margin-top: auto;
  padding: 2rem 0;
}

/* Conteneurs de carte */
.map-container {
  height: 300px;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
}

/* Responsive */
@media (min-width: 576px) {
  .container {
    max-width: 540px;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 720px;
  }
  
  .col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }
  
  .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
  
  .col-md-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
  }
  
  .col-md-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

@media (min-width: 992px) {
  .container {
    max-width: 960px;
  }
  
  .col-lg-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }
  
  .col-lg-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
  
  .col-lg-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
  }
  
  .col-lg-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }
}

/* Card styling */
.news-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-card .card-img-top {
  height: 150px;
  object-fit: cover;
  flex: 0 0 auto;
}

.news-card .card-body {
  flex: 1 1 auto;
}

.news-card .card-footer {
  margin-top: auto;
}

/* Fixer les hauteurs pour les éléments stats */
.stats-card {
  height: 100%;
}

.stats-card .card-body {
  padding: 1.25rem;
  display: flex;
  align-items: center;
}

/* Theme switcher */
.theme-switcher .btn {
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all var(--transition-speed) ease;
}

.theme-switcher .btn:hover {
  color: white;
  border-color: rgba(255, 255, 255, 0.4);
}

.theme-switcher .dropdown-item.active,
.theme-switcher .dropdown-item:active {
  background-color: #0d6efd;
}

/* Section map */
.map-element {
  width: 100%;
  height: 100%;
}

/* Fix pour les tailles d'icônes */
.fa-2x {
  font-size: 2em !important;
}

.fa-3x {
  font-size: 3em !important;
}

/* News items */
.news-item {
  transition: background-color var(--transition-speed) ease;
}

.news-item.active {
  background-color: rgba(13, 110, 253, 0.1);
  border-left: 4px solid #0d6efd;
}

/* Optimisation des transitions (uniquement propriétés peu coûteuses) */
.transition-colors {
  transition: color var(--transition-speed) ease, 
              background-color var(--transition-speed) ease, 
              border-color var(--transition-speed) ease;
}

/* Appliquer transitions optimisées */
.navbar,
.btn,
.form-control,
.form-select,
.badge,
.news-item,
.dropdown-item {
  transition: color var(--transition-speed) ease, 
              background-color var(--transition-speed) ease, 
              border-color var(--transition-speed) ease;
}

/* Styles pour les badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Styles pour les alertes */
.alert {
    border-radius: 0.5rem;
}

/* Styles de mise en surbrillance pour les résultats de recherche */
.highlight {
    background-color: rgba(255, 230, 0, 0.2);
    border-radius: 2px;
    padding: 0 2px;
}

/* Styles pour les conteneurs de cartes */
.map-container, .chart-container {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Styles pour les boutons */
.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.btn-outline-primary {
    color: #0d6efd;
    border-color: #0d6efd;
}

.btn-outline-primary:hover {
    background-color: #0d6efd;
    color: #fff;
}

/* Styles pour la typographie */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}

/* Styles de navigation */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-link {
    font-weight: 500;
}

.nav-link.active {
    font-weight: 600;
}

/* Styles pour les icônes */
.fas, .far, .fab {
    vertical-align: middle;
}

/* Media queries pour la responsivité */
@media (max-width: 768px) {
    .card-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 1.8rem;
    }
}

/* Styles pour les sections spécifiques */
.news-section, .map-section, .stats-section {
    margin-bottom: 2rem;
}

/* Styles pour les actualités en vedette */
.featured-news {
    border-left: 5px solid #0d6efd;
}

/* Styles de cohérence pour la hauteur des cartes */
.card-deck .card,
.row .card {
    height: 100%;
}

/* Ensure footer stays at bottom */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
} 