/* style.css - Global styles for the whole site (light & dark) */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;600;700&display=swap');

:root{
  --bg: #f9f9f9;
  --card:#ffffff;
  --text:#222;
  --muted:#666;
  --primary:#0ea5e9;
  --accent:#00aaff;
  --success:#28a745;
  --danger:#ff3547;
  --header:#181818;
}

*{box-sizing:border-box;margin:0;padding:0;font-family: 'Roboto',sans-serif;}

body{
  background:var(--bg);
  color:var(--text);
  min-height:100vh;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}

/* ---------------- Header / Nav ---------------- */
header{
  background:var(--header);
  color:#fff;
  display:flex;
  gap:1rem;
  align-items:center;
  justify-content:space-between;
  padding:0.9rem 1rem;
  flex-wrap:wrap;
}
.logo{font-weight:700;font-size:1.25rem;}
nav{display:flex;gap:0.6rem;align-items:center;flex-wrap:wrap;}
nav a{color:#fff;text-decoration:none;padding:0.45rem 0.6rem;border-radius:6px;font-weight:600;}
nav a:hover, nav a.active{background:rgba(255,255,255,0.06);color:var(--accent);}

/* Header controls (search, dark-mode) */
.header-controls{display:flex;gap:0.5rem;align-items:center;}
.search-box{display:flex;gap:0.4rem;align-items:center;}
.search-box input{padding:0.45rem 0.6rem;border-radius:6px;border:1px solid rgba(255,255,255,0.08);min-width:180px;}
.search-box button{padding:0.45rem 0.7rem;border-radius:6px;border:none;background:var(--accent);color:#fff;cursor:pointer}

/* ---------------- Hero ---------------- */
.hero{padding:2.5rem 1rem;text-align:center;background:linear-gradient(135deg,var(--primary),#006f9a);color:#fff;border-bottom-left-radius:24px;border-bottom-right-radius:24px;margin-bottom:1rem;}
.hero h1{font-size:2rem;margin-bottom:0.5rem;}
.hero p{opacity:0.95;margin-bottom:1rem;}

/* ---------------- Layout containers ---------------- */
.container{max-width:1100px;margin:1.25rem auto;padding:0 1rem;}

/* grid for lists */
.grid {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
  gap:1rem;
}

/* ---------------- Card (news, products, services...) ---------------- */
.card{
  background:var(--card);
  border-radius:12px;
  overflow:hidden;
  box-shadow:0 6px 18px rgba(0,0,0,0.06);
  transition:transform .18s ease,box-shadow .18s ease;
  display:flex;
  flex-direction:column;
}
.card:hover{transform:translateY(-6px);box-shadow:0 12px 30px rgba(0,0,0,0.08);}
.card img{width:100%;height:160px;object-fit:cover;display:block;}
.card-body{padding:0.9rem 1rem;flex:1;display:flex;flex-direction:column;}
.card-body h3{font-size:1.05rem;margin-bottom:0.5rem;}
.card-body h3 a{color:var(--header);text-decoration:none;}
.card-body p{color:var(--muted);font-size:0.94rem;flex:1;}
.card-meta{display:flex;justify-content:space-between;align-items:center;margin-top:0.6rem;font-size:0.86rem;color:var(--muted);}

/* -------------- Buttons -------------- */
.btn{display:inline-block;background:var(--accent);color:#fff;padding:0.55rem 0.9rem;border-radius:8px;text-decoration:none;font-weight:700;border:none;cursor:pointer}
.btn.ghost{background:transparent;color:var(--accent);border:1px solid rgba(0,0,0,0.06)}
.small{padding:0.35rem 0.6rem;font-size:0.9rem}

/* -------------- Pagination -------------- */
.pagination{display:flex;gap:0.5rem;align-items:center;justify-content:center;margin:1.5rem 0}
.pagination .btn{min-width:110px}
#page-indicator{font-weight:700;color:var(--muted)}

/* -------------- Refresh controls & Timer -------------- */
.controls{display:flex;gap:0.6rem;align-items:center;justify-content:center;margin:0.8rem 0}
#refresh-timer{color:var(--muted);font-style:italic}
#refresh-now{background:var(--success)}

/* -------------- Notification alert (in-page) -------------- */
#new-articles-alert{position:fixed;right:20px;bottom:22px;padding:0.8rem 1rem;background:#ffcc00;color:#111;border-radius:8px;box-shadow:0 6px 18px rgba(0,0,0,0.18);display:none;z-index:1200}
#new-articles-alert.show{display:block}

/* -------------- Share buttons -------------- */
.share-buttons{display:flex;gap:0.5rem;flex-wrap:wrap;margin-top:0.7rem}
.share-buttons a, .share-buttons button{padding:0.45rem 0.7rem;border-radius:8px;color:#fff;text-decoration:none;font-size:0.9rem;border:none;cursor:pointer}
.share-whatsapp{background:#25d366}
.share-fb{background:#1877f2}
.share-twitter{background:#1da1f2}
.share-copy{background:#666}

/* -------------- Detail page -------------- */
.detail-container{max-width:900px;margin:2rem auto;padding:1.6rem;background:var(--card);border-radius:12px;box-shadow:0 6px 18px rgba(0,0,0,0.06)}
.detail-container h2{font-size:1.6rem;margin-bottom:0.4rem}
.detail-container .date{color:var(--muted);font-size:0.9rem;margin-bottom:0.8rem}
.detail-container img{width:100%;height:auto;border-radius:8px;margin:0.8rem 0}
.detail-content{font-size:1rem;color:var(--text);line-height:1.7;margin-bottom:1rem}

/* likes/dislikes */
.likes{display:flex;gap:0.5rem;align-items:center}
.likes button{padding:0.5rem 0.9rem;border-radius:8px;border:none;cursor:pointer}
.like-btn{background:var(--success);color:#fff}
.dislike-btn{background:var(--danger);color:#fff}
.like-count, .dislike-count{font-weight:700;margin-left:0.4rem;color:var(--muted)}

/* comments */
.comments{margin-top:1.2rem;text-align:left}
.comments textarea{width:100%;min-height:90px;padding:0.7rem;border-radius:8px;border:1px solid #e2e2e2;margin-bottom:0.6rem}
.comments button{background:var(--accent);color:#fff;border:none;padding:0.6rem 0.9rem;border-radius:8px}
.comment-list{list-style:none;padding:0;margin-top:0.6rem}
.comment-list li{background:#f4f4f4;padding:0.6rem;border-radius:6px;margin-bottom:0.45rem;color:var(--text)}

/* -------------- Footer -------------- */
footer{background:var(--header);color:#fff;text-align:center;padding:1rem;margin-top:2rem}

/* -------------- Responsive -------------- */
@media (max-width:900px){
  .card img{height:150px}
  .hero h1{font-size:1.6rem}
  nav a{padding:0.4rem 0.5rem}
}
@media (max-width:600px){
  header{padding:0.75rem}
  .card img{height:130px}
  .search-box input{min-width:120px}
  .grid{grid-template-columns: 1fr}
  .hero{padding:1.5rem 1rem}
}

/* -------------- DARK MODE -------------- */
body.dark-mode{
  --bg:#0f1720;
  --card:#0b1220;
  --text:#e6eef8;
  --muted:#a0aab3;
  --primary:#06b6d4;
  --accent:#38bdf8;
  --success:#16a34a;
  --danger:#ef4444;
  --header:#07122b;
}
body.dark-mode header nav a{color:#dbeafe}

/* video iframe responsiveness */
.detail-container iframe, .detail-container video {
  width:100%;
  height:480px;
  border-radius:8px;
}
@media (max-width:600px){
  .detail-container iframe, .detail-container video { height:240px; }
}


 /* ------------------------------
   STYLE.CSS - Version cartes + pagination
   ------------------------------ */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;600&display=swap');

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

body {
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
  background: #f8f9fa;
  color: #333;
  transition: background 0.3s, color 0.3s;
}

/* Mode sombre */
body.dark-mode {
  background: #121212;
  color: #ddd;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: #0066cc;
  color: #fff;
  flex-wrap: wrap;
}

header .logo {
  font-weight: bold;
  font-size: 1.4rem;
}

header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

header nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  padding: 5px 8px;
  border-radius: 4px;
  transition: background 0.3s;
}

header nav a:hover,
header nav a.active {
  background: rgba(255, 255, 255, 0.2);
}

.header-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

#dark-mode-toggle {
  background: transparent;
  border: 1px solid #fff;
  color: #fff;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
}

/* Conteneur principal */
main {
  max-width: 1100px;
  margin: 20px auto;
  padding: 0 15px;
}

/* Titres */
main h1 {
  margin-bottom: 20px;
  font-size: 1.8rem;
  color: #0066cc;
}

body.dark-mode main h1 {
  color: #4da3ff;
}

/* Grille d’articles */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* Carte */
.card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

body.dark-mode .card {
  background: #1e1e1e;
  color: #ddd;
}

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

.card-top {
  position: relative;
}

.card-top img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.video-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 4px 6px;
  font-size: 0.8rem;
  border-radius: 4px;
}

.card-body {
  padding: 15px;
}

.card-body h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.card-body h3 a {
  text-decoration: none;
  color: #0066cc;
}

body.dark-mode .card-body h3 a {
  color: #4da3ff;
}

.card-body p {
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.card-meta {
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  color: #777;
}

body.dark-mode .card-meta {
  color: #aaa;
}

/* Boutons */
.btn {
  padding: 6px 12px;
  border: none;
  border-radius: 5px;
  background: #0066cc;
  color: #fff;
  cursor: pointer;
  transition: background 0.3s;
}

.btn:hover {
  background: #004d99;
}

body.dark-mode .btn {
  background: #4da3ff;
  color: #000;
}

body.dark-mode .btn:hover {
  background: #1f7ce0;
}

/* Pagination */
.pagination {
  margin: 25px 0;
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
}

#page-indicator {
  font-weight: bold;
}

/* Refresh controls */
.controls {
  text-align: center;
  margin: 15px 0;
  font-size: 0.9rem;
  color: #555;
}

body.dark-mode .controls {
  color: #bbb;
}

/* Alerte nouveaux articles */
#new-articles-alert {
  display: none;
  position: fixed;
  bottom: 15px;
  right: 15px;
  background: #ff9800;
  color: #fff;
  padding: 12px 15px;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  z-index: 1000;
}

#new-articles-alert button {
  margin-left: 10px;
  background: #fff;
  color: #ff9800;
  border: none;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
}

/* Boutons partage */
.share-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.share-buttons a,
.share-buttons button {
  font-size: 0.75rem;
  padding: 4px 6px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.share-whatsapp {
  background: #25d366;
  color: #fff;
}

.share-fb {
  background: #1877f2;
  color: #fff;
}

.share-twitter {
  background: #1da1f2;
  color: #fff;
}

.share-copy {
  background: #555;
  color: #fff;
}

/* Footer */
footer {
  margin-top: 40px;
  padding: 20px;
  text-align: center;
  background: #0066cc;
  color: #fff;
}

body.dark-mode footer {
  background: #1e1e1e;
}
