/* =========================
 GLOBAL STYLES
========================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: 'Poppins', Arial, Helvetica, sans-serif;
  background-color: white;
  color: #444;
  transition: background-color 0.5s ease, color 0.5s ease;
  display: flex;
  flex-direction: column;
  min-height: 100vh; 
}

/* =========================
 HEADER: SOCIAL ICONS & DARK MODE
========================= */
header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 15px;
  background-color: #7c9758;
  color: black;
  padding: 10px 20px;
  position: relative;
  transition: background-color 0.5s ease;
}

header .social-icons {
  display: flex;
  gap: 10px;
  align-items: center;
}

header .fa-brands {
  font-size: 25px;
  color: rgb(247, 207, 5);
  padding: 10px;
  margin: 0 2px;
  text-decoration: none;
  transition: opacity 0.3s;
}

header .fa-brands:hover { 
  opacity: 0.8; 
}
header .fa-brands:active { 
  opacity: 0.5; 
}

/* Dark Mode Toggle Button */
header .dark-toggle {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  border: none;
  background-color: rgb(247, 207, 5);
  color: #000;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 
    background-color 0.5s ease, 
    color 0.5s ease, 
    transform 0.2s ease,
    box-shadow 0.5s ease;
}

header .dark-toggle:hover {
  transform: scale(1.1);
  background-color: #f2d44d;
}

body.dark-mode header .dark-toggle {
  background-color: #444;
  color: #f0c933;
  box-shadow: 0 0 12px 3px #f0c933;
}

/* =========================
 SECOND HEADER: NAVIGATION
========================= */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #a8bf8a;
  padding: 10px 20px;
  transition: background-color 0.5s ease;
}

.nav-left, .nav-right { display: flex; gap: 20px; }

.header a {
  color: #3b594b;
  text-decoration: none;
  font-size: 13.5px;
  line-height: 25px;
  padding: 6px 10px;
  border-radius: 4px;
  font-weight: 600;
  transition: color 0.5s ease;
}

.header a:hover {
  color: white;
  text-decoration: underline;
  text-underline-offset: 6px;
  opacity: 0.8;
}

.main-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* =========================
   HERO + SEARCH BAR
========================= */
.main-content {
  flex: 1; 
}

.learning-hero {
  text-align: center;
}

.learning-hero h1{
  text-align: center;
  font-size: 2.8rem;
  color: #4F6A58;
  font-family: 'Playfair Display', serif;
  margin: 2rem 0;
  position: relative;
}

.learning-hero h1::after {
  content: "";
  display: block;
  width: 80px;
  height: 4px;
  background: #f7cf05;
  margin: 10px auto 0; 
  border-radius: 2px;
}

.learning-hero p {
  font-size: 18px;
  margin-top: 10px;
}

.search-box {
  margin: 34px auto;
  position: relative;
  width: 300px;
  max-width: 90%;
}

.search-box input {
  width: 100%;
  padding: 15px 15px;
  border-radius: 20px;
  border: 1px solid #ccc;
  outline: none;
  background: #fdfdfd;
  transition: box-shadow 0.3s ease;
}

.search-box input:focus {
  box-shadow: 0 0 10px rgba(124, 151, 88, 0.5);
}

.search-box i {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #3b594b;
  pointer-events: none;
}

/* =========================
   CATEGORY CARDS
========================= */
.categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  max-width: 1000px;
  margin: -40px auto 40px;
    padding: 50px;

}

.category-card {
  background: #ffffff;
  height: 155px;   
  justify-content: center;    
  padding: 20px;
  border-radius: 15px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0px 3px 12px rgba(0, 0, 0, 0.1);
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0px 8px 20px rgba(0,0,0,0.1);
  background: #d4e0c0;
}

.category-card.active {
  background-color: #7c9758;
  color: white;
}

.icon {
  font-size: 40px;
  color: #7c9758;
  margin-bottom: 15px;
}

.category-card.active .icon {
  color: #fdfdfd;
}

.card-link {
  text-decoration: none; 
  color: inherit;        
  display: block;        
}


/* =========================
   RESPONSIVE
========================= */
@media (max-width: 600px) {
  .categories {
    grid-template-columns: 1fr; /* stacked cards on small screens */
    gap: 15px;
  }

  .category-card {
    padding: 20px;
  }
}

/* =========================
   FOOTER
========================= */
footer {
  text-align: center;
  padding: 20px;
  background: #f8f8f8;
  font-size: 13px;
  color: #666;
  margin-top: 50px;
}

/* =========================
   DARK MODE STYLES
========================= */
body.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
}

body.dark-mode .header { 
  background-color: #3b594b;
}
body.dark-mode header { 
  background-color: #10241b; 
}

body.dark-mode .nav-left a,
body.dark-mode .nav-right a{
  color: #f0c933; 
}

body.dark-mode .category-card {
  background: #1f1f1f;
  color: #ddd;
  box-shadow: 0px 3px 12px rgba(0, 0, 0, 0.4);
}

body.dark-mode .category-card:hover {
  background: #333333;
}

body.dark-mode .category-card.active {
  background-color: #7c9758;
}

body.dark-mode .search-box input {
  background-color: #222;
  color: #e0e0e0;
  border-color: #444;
}

body.dark-mode .search-box input:focus {
  box-shadow: 0 0 10px rgba(240, 201, 51, 0.6);
}

body.dark-mode .icon {
 color: #A3C28B;
}
body.dark-mode footer {
  background: #000;
  color: #7c9758;
}

body.dark-mode .categories h3{
  color: #A3C28B;
}

/* =========================
   RESPONSIVE DESIGN
========================= */
/* =========================
   BIEC MOBILE – STELLAR STYLE
========================= */
@media screen and (max-width: 600px) {

  /* ===== TOP HEADER ===== */
  header {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px;
    padding: 10px 12px;
  }

  header .social-icons {
    display: flex !important;
    flex-direction: column !important;
    align-items: center;
    gap: 8px;
  }

  header .fa-brands {
    font-size: 18px;
    padding: 6px;
  }

  header .dark-toggle {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  /* ===== NAV BAR (STACKED LIKE STELLAR) ===== */
  .header {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px;
    padding: 10px 12px;
  }

  .nav-left,
  .nav-right {
    display: flex !important;
    flex-direction: column !important;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .header a {
    font-size: 12px;          
    letter-spacing: 0.4px;
    padding: 6px 0;
    width: 100%;
    text-align: center;
  }

  /* ===== HERO TEXT ===== */
  .learning-hero h1 {
    font-size: 22px;
    margin: 1.4rem 0;
  }

  .learning-hero p {
    font-size: 13px;
    line-height: 1.6;
  }

  /* ===== SEARCH BAR ===== */
  .search-box {
    width: 90%;
    margin: 24px auto;
  }

  .search-box input {
    padding: 12px;
    font-size: 13px;
  }

  /* ===== CATEGORY CARDS ===== */
  .categories {
    padding: 30px 15px;
    gap: 14px;
  }

  .category-card {
    padding: 18px;
    height: auto;
  }

  .category-card h3 {
    font-size: 14px;
  }

  .icon {
    font-size: 30px;
    margin-bottom: 10px;
  }

  /* ===== FOOTER ===== */
  footer {
    font-size: 12px;
    padding: 16px;
  }
}
