/* =========================
   GLOBAL & RESET
========================= */

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

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  font-size: 0.97rem;
  animation: fadeIn 0.7s ease forwards;
  opacity: 0;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #00eaff, #0077cc);
  border-radius: 10px;
}
::-webkit-scrollbar-track {
  background: #0f0f0f;
}

/* =========================
   THEME VARIABLES
========================= */

:root {
  --bg: #0d0d0d;
  --text: #eaeaea;
  --card-bg: rgba(25, 25, 25, 0.9);
  --accent: #00eaff;
}

.light-mode {
  --bg: #f5f5f5;
  --text: #222;
  --card-bg: rgba(255, 255, 255, 0.9);
  --accent: #0077cc;
}

/* =========================
   KEY ANIMATIONS
========================= */

@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(25px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.85; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes glow {
  0% { text-shadow: 0 0 0px var(--accent); }
  50% { text-shadow: 0 0 12px var(--accent); }
  100% { text-shadow: 0 0 0px var(--accent); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* =========================
   REVEAL CLASS
========================= */

.reveal {
  opacity: 0;
  transform: translateY(25px);
  transition: 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================
   HEADER & NAVBAR
========================= */

header {
  background: rgba(15, 15, 15, 0.9);
  color: #fff;
  padding: 1.4rem 1rem;
  text-align: center;
  box-shadow: 0 2px 14px rgba(0,0,0,0.45);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  animation: fadeUp 0.7s ease;
}

header h1 {
  font-size: 1.8rem;
  margin-bottom: 0.4rem;
}

header .subtitle {
  font-size: 0.98rem;
  opacity: 0.85;
}

/* Nav */
nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 0.7rem;
  flex-wrap: wrap;
}

nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.3px;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.25s ease;
}

nav a:hover {
  color: var(--accent);
}

nav a::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0%;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease, left 0.3s ease;
}

nav a:hover::after {
  width: 100%;
  left: 0;
}

/* When scrolled (JS adds .scrolled) */
nav.scrolled {
  opacity: 0.98;
}

/* =========================
   HAMBURGER (MOBILE)
========================= */

.hamburger {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 5100;
  width: 28px;
  height: 22px;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.hamburger span {
  height: 3px;
  background: var(--accent);
  border-radius: 10px;
}

/* Optional active state */
.hamburger.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Mobile nav open */
nav.mobile-open {
  display: flex;
}

/* =========================
   THEME TOGGLE & BACK TO TOP
========================= */

#theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 5000;
  background: var(--accent);
  color: #000;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 30px;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.3s ease;
}

#theme-toggle:hover {
  transform: scale(1.1);
}

#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--accent);
  color: #000;
  border: none;
  padding: 0.8rem 1rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.3rem;
  display: none;
  transition: transform 0.3s ease, background 0.3s ease;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

#backToTop:hover {
  transform: scale(1.15);
}

/* =========================
   ICON ANIMATIONS
========================= */

.icon {
  display: inline-block;
  margin-right: 8px;
  font-size: 1.4rem;
}

.float {
  animation: float 3s ease-in-out infinite;
}

.pulse {
  animation: pulse 1.8s ease-in-out infinite;
}

.glow {
  animation: glow 2.4s ease-in-out infinite;
}

.spin {
  animation: spin 3.5s linear infinite;
}

/* =========================
   GRID & CARDS (INDEX + MODULES)
========================= */

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.7rem;
  padding: 3rem 2rem;
}

.module-card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 1.7rem;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow: 0 4px 18px rgba(0,0,0,0.55);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeUp 0.8s ease;
}

.module-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 12px 30px rgba(0,0,0,0.7);
}

.module-card h2 {
  color: var(--accent);
  margin-bottom: 1rem;
  font-size: 1.35rem;
}

/* =========================
   PROJECTS PAGE
========================= */

.projects-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 2.5rem 2rem;
}

.project-card {
  flex: 1 1 280px;
  background: linear-gradient(135deg, #3fcfa4, #1a5f9d);
  border-radius: 14px;
  padding: 1.5rem;
  color: #fff;
  box-shadow: 0 4px 18px rgba(0,0,0,0.55);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: fadeUp 0.8s ease;
}

.project-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 10px 26px rgba(0,0,0,0.65);
}

.project-card h3 {
  margin-bottom: 0.6rem;
}

.project-card a {
  display: inline-block;
  margin-top: 0.8rem;
  background: var(--accent);
  color: #000;
  padding: 0.55rem 1.2rem;
  border-radius: 40px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.25s ease, transform 0.2s ease;
}

.project-card a:hover {
  background: #00bcd4;
  transform: scale(1.08);
}

/* =========================
   CONTACT PAGE
========================= */

.contact-wrapper {
  animation: fadeUp 0.8s ease;
}

.contact-card {
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.05);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.75);
}

.contact-input {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  transition: 0.25s ease;
}

.contact-input:focus {
  background: rgba(255,255,255,0.12);
  border-color: var(--accent);
  transform: scale(1.02);
  box-shadow: 0 0 10px var(--accent);
}

/* Neon Button (used globally too) */
.btn-neon {
  background: var(--accent);
  color: #000;
  font-weight: 600;
  border-radius: 8px;
  transition: 0.3s ease;
  box-shadow: 0 0 12px var(--accent);
  border: none;
}

.btn-neon:hover {
  background: #00bcd4;
  box-shadow: 0 0 18px #00eaff;
  transform: scale(1.05);
}

/* =========================
   TABLES (EXERCISES PAGE)
========================= */

.neon-table {
  margin-top: 1rem;
}

.neon-table thead {
  background: rgba(255,255,255,0.1);
  color: var(--accent);
}

.neon-table tbody tr:hover {
  background: rgba(255,255,255,0.05);
  transition: 0.25s ease;
}

.neon-table td,
.neon-table th {
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Legacy generic table styles (if used somewhere else) */
table {
  width: 90%;
  margin: 2rem auto;
  border-collapse: collapse;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 25px rgba(0,0,0,0.6);
  animation: fadeUp 0.8s ease;
}
table th, table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
table th {
  background: rgba(255,255,255,0.05);
  font-weight: 600;
  color: var(--accent);
}
table tr:last-child td {
  border-bottom: none;
}
table tr:hover {
  background: rgba(255,255,255,0.03);
  transition: background 0.25s ease;
}

/* =========================
   VIDEO (EXERCISES PAGE)
========================= */

video {
  display: block;
  margin: 2rem auto;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}

/* =========================
   FOOTER
========================= */

footer {
  background: #0f0f0f;
  color: #aaa;
  text-align: center;
  padding: 1.4rem;
  margin-top: 3rem;
  letter-spacing: 0.5px;
  border-top: 1px solid rgba(255,255,255,0.05);
  animation: fadeIn 4s ease forwards; 
  opacity: 0;
}

/* RESPONSIVE */

@media (max-width: 768px) {
  nav {
    gap: 1rem;
    font-size: 0.9rem;
  }

  .modules-grid {
    padding: 2rem 1rem;
    grid-template-columns: 1fr;
  }

  .projects-list {
    padding: 2rem 1rem;
  }

  .hamburger {
    display: flex;
  }

  #theme-toggle {
    top: 15px;
    right: 15px;
  }

  #backToTop {
    bottom: 20px;
    right: 20px;
  }
}
