/* ======== GLOBAL RESET ======== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ======== VARIABLES ======== */
:root {
  /* Couleurs générales */
  --bg-color: #0e0e12;
  --text-color: #f5f5f5;
  --card-bg: #1a1a1f;
  --border-color: #2e2e38;
  --accent-color: #4dabf7;
  --accent-hover: #74c0fc;
  
  /* Couleurs universités */
  --ulagunes: #0066cc;
  --uca: #e4032e;
  --epitech: #00a8ff;
  
  /* Autres */
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  --transition: all 0.3s ease;
  --radius: 12px;
  --font-family: 'Poppins', sans-serif;
}

/* Light mode overrides */
.light-mode {
  --bg-color: #f7f8fa;
  --text-color: #222;
  --card-bg: #ffffff;
  --border-color: #e0e0e0;
  --accent-color: #007acc;
  --accent-hover: #005f99;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

/* ======== BODY ======== */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-family);
  line-height: 1.6;
  transition: var(--transition);
  min-height: 100vh;
}

/* ======== CONTAINER ======== */
.container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ======== HEADER ======== */
.site-header {
  background-color: var(--card-bg);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  gap: 2rem;
}

.brand {
  font-weight: 700;
  color: var(--accent-color);
  font-size: 1.4rem;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

.brand:hover {
  opacity: 0.8;
}

/* ======== NAVIGATION ======== */
.main-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.main-nav a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--accent-color);
  background: var(--bg-color);
}

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--accent-color);
  color: var(--accent-color);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  transition: var(--transition);
}

.nav-toggle:hover {
  background: var(--accent-color);
  color: white;
}

/* ======== LANGUAGE SWITCHER ======== */
.lang-switcher {
  position: fixed;
  top: 90px;
  right: 20px;
  z-index: 999;
  background: var(--card-bg);
  border-radius: 50px;
  padding: 0.5rem;
  box-shadow: var(--shadow);
  display: flex;
  gap: 0.5rem;
  border: 2px solid var(--accent-color);
}

.lang-btn {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 25px;
  font-weight: 600;
  transition: var(--transition);
  color: var(--text-color);
  font-size: 0.9rem;
}

.lang-btn:hover {
  background: var(--bg-color);
}

.lang-btn.active {
  background: var(--accent-color);
  color: white;
}

/* ======== HEADER ACTIONS ======== */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#theme-toggle {
  background: var(--bg-color);
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: var(--transition);
}

#theme-toggle:hover {
  transform: scale(1.1);
}

/* ======== BUTTONS ======== */
.btn,
button[type="submit"],
input[type="submit"] {
  background-color: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.65rem 1.6rem;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.btn:hover,
button[type="submit"]:hover {
  background-color: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--accent-color);
  color: var(--accent-color);
}

.btn-outline:hover {
  background-color: var(--accent-color);
  color: #fff;
}

.btn-ghost {
  background-color: transparent;
  color: var(--accent-color);
  border: 2px solid transparent;
}

.btn-ghost:hover {
  border-color: var(--accent-color);
}

/* ======== CARDS ======== */
.card {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 2rem;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.card h2, .card h3, .card h4 {
  color: var(--accent-color);
  margin-bottom: 1rem;
}

.card.highlight {
  border-left: 4px solid var(--accent-color);
}

/* ======== SECTIONS ======== */
.section-title {
  font-size: 2rem;
  color: var(--accent-color);
  text-align: center;
  margin: 3rem 0 2rem;
}

/* ======== HERO SECTION ======== */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  padding: 3rem 0;
}

.profile-pic {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow);
  margin-bottom: 1.2rem;
}

.hero-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.subtitle {
  color: #444;
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.hero-ctas {
  margin: 1.5rem 0;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.quick-info {
  list-style: none;
  margin-top: 1rem;
}

.quick-info li {
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.quick-info a {
  color: var(--accent-color);
  text-decoration: none;
  transition: var(--transition);
}

.quick-info a:hover {
  text-decoration: underline;
}

/* ======== SKILLS ======== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.skill {
  background: var(--bg-color);
  padding: 1.5rem;
  border-radius: var(--radius);
  text-align: center;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.skill:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow);
  border-color: var(--accent-color);
}

.skill img,
.skill i {
  width: 60px;
  height: 60px;
  margin-bottom: 0.8rem;
  object-fit: contain;
  font-size: 3rem;
}

.skill p {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.skill-level {
  background: var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  height: 8px;
  margin-top: 0.8rem;
}

.skill-level div {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(to right, #3498db, #2ecc71);
  transition: width 0.6s ease;
}

.extra-skill {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.extra-skill.visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.extra-skill.visible:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow);
  border-color: var(--accent-color);
}

/* ======== ANIMATIONS ======== */
.slide-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ======== GRIDS ======== */
.grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.achievements.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  padding: 3rem 0;
}

/* ======== FOOTER ======== */
.site-footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  color: var(--text-color);
  text-align: center;
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer-links {
  margin-top: 1rem;
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--accent-color);
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  text-decoration: underline;
  opacity: 0.8;
}

/* ======== FORMS ======== */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-top: 1.5rem;
  width: 100%;
  max-width: 600px;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  font-weight: 500;
  color: var(--text-color);
}

.contact-form input,
.contact-form textarea {
  margin-top: 0.4rem;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius);
  font-family: var(--font-family);
  font-size: 1rem;
  transition: var(--transition);
  background: var(--bg-color);
  color: var(--text-color);
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.15);
  outline: none;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.contact {
  padding: 2rem;
  background-color: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  margin-top: 2rem;
}

.contact-meta {
  margin-top: 2rem;
}

.contact-meta h3 {
  color: var(--accent-color);
  font-weight: 600;
  margin-bottom: 0.8rem;
}

/* ======== BREADCRUMB ======== */
.breadcrumb {
  margin: 1rem 0;
  font-size: 0.9rem;
  color: var(--text-color);
}

.breadcrumb a {
  color: var(--accent-color);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* ========================================
   RESPONSIVE DESIGN 
   ======================================== */

/* TABLETS (768px - 1024px) */
@media (max-width: 1024px) {
  .container {
    padding: 0 1.5rem;
  }
  
  .subjects-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

/* LARGE MOBILE & TABLETS (max-width: 968px) */
@media (max-width: 968px) {
  .nav-inner {
    flex-wrap: wrap;
  }
  
  .main-nav {
    order: 3;
    width: 100%;
    display: none;
    flex-direction: column;
    background: var(--card-bg);
    padding: 1rem;
    border-radius: var(--radius);
    margin-top: 1rem;
    box-shadow: var(--shadow);
  }

  .main-nav.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .header-actions {
    gap: 0.5rem;
  }

  .lang-switcher {
    top: auto;
    bottom: 20px;
    right: 20px;
  }
}

/* LARGE MOBILE (max-width: 800px) */
@media (max-width: 800px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .profile-pic {
    margin: 0 auto 1rem;
  }

  .hero-left {
    align-items: center;
  }
}

/* LARGE MOBILE (768px) */
@media (max-width: 768px) {
  /* Container */
  .container {
    width: 95%;
  }

  /* Header & Navigation */
  .site-header {
    padding: 0.8rem 0;
  }
  
  .nav-inner {
    gap: 1rem;
  }
  
  .main-nav a {
    padding: 0.8rem;
    border-bottom: 1px solid var(--border-color);
  }
  
  .header-actions {
    flex-direction: row;
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  
  .btn-outline {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    white-space: nowrap;
  }

  /* Hero Section */
  .univ-hero {
    padding: 2rem 1rem;
  }
  
  .univ-hero h1 {
    font-size: 1.8rem;
  }
  
  .univ-hero .subtitle {
    font-size: 1rem;
  }

  /* Year Tabs */
  .year-tabs {
    gap: 0.5rem;
    padding: 0 0.5rem;
  }
  
  .year-tab {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    flex: 1;
    min-width: 100px;
    text-align: center;
  }

  /* Stats Banner */
  .stats-banner {
    flex-direction: column;
    gap: 1rem !important;
    padding: 1.5rem !important;
  }
  
  .stats-banner > div {
    width: 100%;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: var(--radius);
  }

  /* Breadcrumb */
  .breadcrumb {
    font-size: 0.85rem;
    padding: 0.5rem 0;
    flex-wrap: wrap;
  }

  /* Subject Cards */
  .subjects-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
  
  .subject-card {
    padding: 1.2rem;
  }
  
  .subject-card h3 {
    font-size: 1.1rem;
  }

  /* Document Links */
  .doc-link {
    font-size: 0.9rem;
    padding: 0.4rem 0;
  }
  
  .doc-icon {
    font-size: 1rem;
  }

  /* Buttons */
  .show-more-btn {
    width: 100%;
    padding: 0.7rem;
    font-size: 0.9rem;
  }
  
  .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }

  /* Section Titles */
  .section-title {
    font-size: 1.6rem;
  }

  /* Cards */
  .card {
    padding: 1.5rem;
  }

  /* Footer */
  .site-footer {
    padding: 2rem 1rem;
    text-align: center;
  }
  
  .site-footer > div {
    flex-direction: column;
    gap: 1rem !important;
  }
  
  .site-footer a {
    font-size: 0.85rem;
  }

  /* Tabs zone */
  .year-tab,
  .show-more-btn {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .doc-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }
  
  .doc-link:hover {
    background: var(--bg-color);
    padding-left: 0.8rem;
    border-radius: 4px;
  }
}

/*STANDARD MOBILE (480px - 768px) */
@media (max-width: 600px) {
  .container {
    padding: 0 1rem;
  }
  
  .year-tab {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    min-width: 90px;
  }
  
  .card {
    padding: 1.2rem;
  }
}

/* SMALL MOBILE (< 480px) */
@media (max-width: 480px) {
  /* Typography */
  body {
    font-size: 15px;
  }
  
  /* Header */
  .brand {
    font-size: 1.2rem;
  }
  
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .btn-outline {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }
  
  #theme-toggle {
    font-size: 1.2rem;
  }

  /* Navigation */
  .main-nav a {
    font-size: 0.9rem;
    padding: 0.6rem;
  }

  /* Language Switcher */
  .lang-switcher {
    padding: 0.3rem;
  }

  .lang-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }

  /* Hero */
  .univ-hero {
    padding: 1.5rem 0.8rem;
  }
  
  .univ-hero h1 {
    font-size: 1.5rem;
    line-height: 1.3;
  }
  
  .univ-hero .subtitle {
    font-size: 0.9rem;
  }
  
  .univ-hero > div[style*="font-size: 4rem"] {
    font-size: 3rem !important;
  }
  
  .univ-hero p {
    font-size: 0.85rem;
  }

  /* Stats Banner */
  .stats-banner {
    padding: 1rem !important;
  }
  
  .stats-banner > div > div:first-child {
    font-size: 2rem !important;
  }
  
  .stats-banner > div > div:last-child {
    font-size: 0.8rem !important;
  }

  /* Year Tabs */
  .year-tabs {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .year-tab {
    width: 100%;
    padding: 0.7rem;
    font-size: 0.9rem;
  }

  /* Breadcrumb */
  .breadcrumb {
    font-size: 0.75rem;
    gap: 0.3rem;
  }

  /* Cards */
  .card,
  .subject-card {
    padding: 1rem;
    border-radius: 8px;
  }
  
  .subject-card h3 {
    font-size: 1rem;
    margin-bottom: 0.6rem;
  }
  
  .subject-card p {
    font-size: 0.85rem;
    line-height: 1.5;
  }

  /* Document List */
  .document-list li {
    padding: 0.4rem 0;
  }
  
  .doc-link {
    font-size: 0.85rem;
    gap: 0.4rem;
  }
  
  .doc-icon {
    font-size: 0.95rem;
  }

  /* Buttons */
  .show-more-btn {
    padding: 0.6rem;
    font-size: 0.85rem;
    margin-top: 0.8rem;
  }
  
  .btn {
    font-size: 0.9rem;
    padding: 0.7rem 1.5rem;
  }

  /* Section Titles */
  .section-title {
    font-size: 1.3rem;
  }
  
  h2 {
    font-size: 1.4rem;
  }
  
  h3[style*="font-size: 1.5rem"] {
    font-size: 1.2rem !important;
  }

  /* Subjects Grid */
  .subjects-grid {
    gap: 1rem;
  }

  /* Navigation toward other universities */
  section[style*="grid-template-columns"] > a.card {
    padding: 1.5rem 1rem;
  }
  
  section[style*="grid-template-columns"] > a.card > div {
    font-size: 2.5rem !important;
  }
  
  section[style*="grid-template-columns"] > a.card h3 {
    font-size: 1rem;
  }
  
  section[style*="grid-template-columns"] > a.card p {
    font-size: 0.85rem;
  }

  /* Footer */
  .site-footer {
    padding: 1.5rem 0.8rem;
  }
  
  .site-footer p {
    font-size: 0.85rem;
  }
  
  .site-footer a {
    font-size: 0.8rem;
  }

  /* Google Translate */
  #google_translate_element {
    font-size: 0.8rem;
    transform: scale(0.9);
    transform-origin: top left;
  }
}

/* Very Small Mobile (< 360px) */
@media (max-width: 360px) {
  body {
    font-size: 14px;
  }
  
  .container {
    padding: 0 0.8rem;
  }
  
  .univ-hero h1 {
    font-size: 1.3rem;
  }
  
  .year-tab {
    font-size: 0.85rem;
    padding: 0.6rem;
  }
  
  .subject-card {
    padding: 0.8rem;
  }
  
  .doc-link {
    font-size: 0.8rem;
  }
  
  .btn-outline {
    font-size: 0.7rem;
    padding: 0.35rem 0.6rem;
  }
}

/* LANDSCAPE MOBILE MODE */
@media (max-height: 500px) and (orientation: landscape) {
  .univ-hero {
    padding: 1rem;
  }
  
  .univ-hero > div[style*="font-size"] {
    font-size: 2rem !important;
    margin-bottom: 0.5rem;
  }
  
  .univ-hero h1 {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
  }
  
  .stats-banner {
    flex-direction: row !important;
    gap: 1rem !important;
  }
}

/* TABLETS IN PORTRAIT MODE */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .subjects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .year-tabs {
    justify-content: center;
  }
}

/* OPTIMIZATION FOR ACCESSIBILITY */
@media (prefers-reduced-motion: reduce) {
  .slide-in,
  .doc-link,
  .year-tab,
  .show-more-btn,
  .skill,
  .card,
  .btn {
    transition: none !important;
    animation: none !important;
  }
}

/* DARK MODE MOBILE OPTIMISATION */
@media (max-width: 768px) and (prefers-color-scheme: dark) {
  .subject-card {
    border-top-width: 2px;
  }
  
  .doc-link {
    padding: 0.5rem;
  }
}