/* ===================== Font & Reset ===================== */

body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  color: #222;
  background: linear-gradient(120deg, #e8efff, #f7faff);
  background-size: 400% 400%;
  animation: gradientBG 12s ease infinite;
  transition: background 0.5s, color 0.5s;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ===================== Dark Mode ===================== */
body.dark-mode {
  background: #121212;
  color: #ddd;
}

body.dark-mode header,
body.dark-mode nav ul {
  background: #000919;
}

body.dark-mode nav li a {
  color: #ddd;
}

body.dark-mode .card {
  background: #1f1f1f;
  color: #ddd;
}

body.dark-mode footer {
  background: #000919;
  color: #bbb;
}

header {
    display: flex;
    flex-direction: column; /* permite centrare titlu + logo */
    align-items: center;
    position: relative; /* Schimbat din sticky în relative pentru pagini secundare */
    z-index: 1000;
    padding: 1.5rem 1rem; /* Padding mai mic */
    background: #003366;
    color: white;
}

@media (max-width: 768px) {
    header {
        padding: 1rem 0.5rem; /* Foarte compact pe mobil */
    }
    .titles h1 {
        font-size: 1.2rem; /* Text mai mic să nu ocupe linii multe */
    }
}



  .logo-and-titles {
    display: flex;
    flex-direction: column; /* logo + titlu unul sub altul */
    align-items: center;    /* centrare pe orizontală */
    gap: 0.2rem;
  }

  .titles {
    text-align: center;
  }
  


/* Ascunde hamburger pe desktop */
  .hamburger {
    display: none;
  }

/* Dark mode rămâne pe dreapta header */
  .header-buttons {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
  }
  
.logo-and-titles img.logo {
  max-width: 180px;
  height: auto;
  margin-bottom: 0.8rem; /* spațiu sub logo */
}

/* Titlu + subtitlu */
.titles {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.2rem;
}

.titles h1 {
  margin: 0;
  font-size: 1.6rem;
  line-height: 1.2;
}

.titles .subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: #ffd700;
}

/* Header buttons (dark + hamburger) */
.header-buttons {
  display: flex;
  gap: 1rem;
}

/* Dark mode button */
#theme-toggle {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #ffd700;
}


/* Hamburger - doar mobil */
.hamburger {
  display: block; /* mobil */
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #ffd700;
}

/* ===================== Desktop layout ===================== */
@media (min-width: 769px) {
   nav ul.menu {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    background: #004080; /* fundal albastru vizibil */
    position: static; /* să nu se suprapună */
  }

  .logo-and-titles {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }

  .titles {
    text-align: center;
    align-items: center;
  }


  /* Ascunde hamburger pe desktop */
  .hamburger {
    display: none;
  }
  
   /* Dark mode button în dreapta */
  #theme-toggle {
    position: static;
    transform: none;
  }
}

/* ===================== Meniu desktop ===================== */
  
nav ul.menu {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    background: #004080; /* albastru vizibil */
    position: static;     /* să nu se suprapună */
  }
  nav ul.menu li {
    margin: 0 1rem;
    position: relative;
  }

  nav ul.menu li a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    display: block;
  }

  /* Submeniuri desktop */
  nav ul.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #004da8;
    min-width: 200px;
    z-index: 10;
  }

  @media (min-width: 769px) {
  nav ul.menu li:hover > ul.submenu {
    display: block;
  }
}

nav ul.submenu li a {
  color: white;
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Iconițe submeniuri */
nav ul.submenu li img.submenu-icon {
  width: 20px;
  height: auto;
}

/* ===================== MOBILE ===================== */
@media (max-width: 768px) {

  header {
    position: relative;
    z-index: 1000;
  }

  .logo-and-titles {
    flex-direction: column;
    align-items: center;
  }

  .titles h1 {
    font-size: 1.4rem;
  }

  .titles .subtitle {
    font-size: 0.85rem;
  }

  .header-buttons {
    position: static;
    transform: none;
    gap: 0.5rem;
  }

  /* Hamburger vizibil lângă logo */
  .hamburger {
    display: block;
    font-size: 1.8rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #ffd700;
  }

  /* === Meniu mobil === */
  nav ul.menu {
    display: none;
    flex-direction: column;
    width: 100%;
   /* position: fixed;  /* fixat pe ecran, deasupra conținutului */
    top: 0;              /* imediat sub header */
    left: 0;
    background: #004080;
    z-index: 2000;
    max-height: calc(100vh - 90px); /* derulare doar în spațiul vizibil */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  nav ul.menu.show {
    display: flex;
  }

  nav ul.menu li {
    border-bottom: 1px solid rgba(255,255,255,0.2);
    text-align: center;
  }

  /* === Submeniu === */
  nav ul.menu li.dropdown > ul.submenu {
    display: none;
    flex-direction: column;
    background: #003366;
    overflow: visible;
    transition: max-height 0.3s ease;
    position: relative;        /* face parte din flux*/
    max-height: none;     /* se întinde cât are nevoie */
    overflow-y: visible;  /* meniul nu mai face scroll separat */
  }

  nav ul.menu li.dropdown.active > ul.submenu {
    display: flex;
    max-height: 500px;
  }

  nav ul.menu li.dropdown > a::after {
    float: right;
    font-size: 0.7rem;
    transition: transform 0.3s ease;
  }

  nav ul.menu li.dropdown.active > a::after {
    transform: rotate(-180deg);
  }
}

/* === Iconițe (logo mic) din submeniuri === */
nav ul.submenu {
  list-style: none; /* eliminăm bullets */
  padding-left: 0;  /* eliminăm indentarea implicită */
  margin: 0;
  
} 

nav ul.submenu li img.submenu-icon {
  width: 20px;        /* dimensiune mică, echilibrată */
  height: auto;
  margin-right: 0.5rem;
  vertical-align: middle;
}

/* Asigură alinierea textului cu imaginea */
nav ul.submenu li a {
  display: flex;
  align-items: center;
  gap: 0.4rem;         /* spațiu între icon și text */
  color: white;
}



/* ===================== Hero ===================== */
.hero {
  height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: url('img/bg.jpg') center/cover no-repeat;
  color: white;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 40, 85, 0.7);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  padding: 0 1rem;
}

.hero h2 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

/* ===================== Cards ===================== */
.cards {
  padding: 3rem 1rem;
  text-align: center;
  background: #f7faff; /* să fie vizibil */
}

/* Container carduri */
.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

/* Card individual */
.info-card {
  display: flex;
  flex-direction: row;      /* imagine + text unul lângă altul */
  gap: 1rem;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  padding: 1rem;
  max-width: 700px;
}

.info-card.reverse {
  flex-direction: row-reverse;  /* imaginea dreapta */
}

/* Imagine card */
.info-card img {
  max-width: 250px;
  border-radius: 12px;
}


/* Conținut card */
.info-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.info-content h3 {
  margin: 0 0 0.5rem 0;
  color: #003a80;
}

.info-content p {
  margin-bottom: 1rem;
}

/* Buton card */
.info-content .btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #004080;
  color: white;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.3s ease;
}

.info-content .btn:hover {
  background: #0059b3;
}

/* ==== Card Responsiv mobil ==== */
@media (max-width: 768px) {
  .info-card,
  .info-card.reverse {
    flex-direction: column; /* imagine + text vertical */
    text-align: center;
  }

 .info-card img {
    display: block;
    margin: 0 auto;  /* centrăm imaginea */
    width: 100%;     /* sau max-width dacă vrei să păstrezi proporțiile */
    max-width: 300px; /* optional */
  }

  .info-content {
    text-align: center; /* textul centrat sub imagine */
    align-items: center;
  }
  
}


/* Efect fade-in + slide-up */
.info-card {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* Clasa activă pentru animație */
.info-card.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ===================== Carousel ===================== */

.carousel {
  position: relative; /* punctele și butoanele in acest container */
  width: 100%;
  max-width: 900px;
  margin: 2rem auto;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.carousel-container {
  display: flex;
  transition: transform 0.6s ease-in-out;
  position: relative; /* important pentru slide-uri absolute */
}

.slide {
  min-width: 100%;
  opacity: 0;
  transition: opacity 1s ease;
  position: absolute;
  top: 0;
  left: 0;
}

.slide.active {
  opacity: 1;
  position: relative; /* doar slide-ul activ */
}

.slide img {
  display: block;
  width: 100%;
  height: 450px;
  object-fit: cover;
  border-radius: 16px;
  margin: 0 auto; /* centrăm imaginea */
}

.caption {
  text-align: center;
  color: #003a80;
  font-size: 1rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem; /* 🔹 adaugăm spațiu între text și dots */
  font-weight: 500;
  width: 100%;
  box-sizing: border-box;
}

/* Mobile */
@media (max-width: 768px) {
  .slide img {
    height: 250px;
  }

  .caption {
    font-size: 0.9rem;
    margin-top: 0.4rem;
    margin-bottom: 0.6rem; /*  mai puțin spațiu pe mobil */
  }
}


/* Butoane */
.prev, .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  color: white;
  border: none;
  font-size: 2rem;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  border-radius: 50%;
  z-index: 2;
}

.prev:hover, .next:hover {
  background: rgba(0,0,0,0.7);
}

.prev { left: 10px; }
.next { right: 10px; }

/* Puncte (dots) */
.dots {
  position: static;      /* nu mai sunt absolute peste imagine */
  text-align: center;
  margin-top: 1rem;      /* spațiu între text și dots */
}
.dot {
  height: 10px;
  width: 10px;
  margin: 0 4px;
background-color: rgba(173, 216, 230, 0.8); /* mai pronunțată, aurie */
  border-radius: 50%;
  display: inline-block;
  cursor: pointer;
  transition: background-color 0.3s;
}
.caption + .dots {
  margin-top: 0.5rem;
}
.dot.active {
  background-color: #ffd700;
}

/* textul sub imagine, centrat și cu spațiu */
.caption {
  text-align: center;
  color: #003a80;
  font-size: 1rem;
  font-weight: 500;
  margin-top: 0.8rem;
}

@media (max-width: 768px) {
  .slide img {
    height: 250px;
  }
}

.table-wrapper {
  overflow-x: auto;
}

.loading {
  text-align: center;
  font-style: italic;
  color: #555;
}

.loading {
  text-align: left;   /* aliniere la stânga în loc de centru */
  font-style: italic;
  color: #555;
}


/* ===================== Tabele concurenți ===================== */
.concurenti-section table {
  display: block;
  overflow-x: auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.concurenti-section table thead,
.concurenti-section table tbody,
.concurenti-section table tr,
.concurenti-section table th,
.concurenti-section table td {
  white-space: nowrap;
}

.loading {
  text-align: left;
  font-style: italic;
  color: #555;
}

.table-wrapper {
  overflow-x: auto;
  position: relative;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
  border-radius: 8px;
  margin-bottom: 2rem;
}

.table-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 30px;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(to left, rgba(0,0,0,0.1), transparent);
}

/* ===================== Footer ===================== */
footer {
  background: #002855;
  color: white;
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
}

footer a {
  color: #ffd700;
  text-decoration: none;
}

.search-container {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #ddd;
}

#studentCode {
    padding: 10px;
    width: 250px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px; /* Important pentru mobil să nu facă zoom automat */
}

.search-container button {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.result-table td, .result-table th {
    padding: 12px;
    text-align: left;
}
