/* =========================================
   1. CSS VARIABLES (Theming)
   ========================================= */
:root {
  --bg-primary: #0a0f16;
  --bg-secondary: #111a27;
  --accent-cyan: #31beff;
  --accent-glow: rgba(49, 190, 255, 0.3);
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --max-width: 1000px;
  --nav-height: 70px;
}

/* =========================================
   1B. LIGHT THEME OVERRIDES
   ========================================= */
body.light-theme {
  --bg-primary: #e2e8f0;     /* Darkened to a softer light-gray to protect the eyes */
  --bg-secondary: #f1f5f9;   /* Cards are now a soft off-white instead of pure white */
  --accent-cyan: #0284c7;    /* Deeper blue for readability */
  --accent-glow: rgba(2, 132, 199, 0.2);
  --text-main: #0f172a;      /* Dark slate for main body text */
  --text-muted: #475569;     /* Gray slate for secondary text */
}

/* Fix: Force Nav Links to stay white against the dark glass header */
.light-theme nav a {
  color: #f8fafc;
}

.light-theme nav a:hover {
  color: var(--accent-cyan);
}

/* Fix: Force Utility Buttons (Theme/Lang) to stay white in the header */
.light-theme .utility-btn {
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.5);
}

.light-theme .utility-btn:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

/* =========================================
   2. BASE RESET & BODY LAYOUT
   ========================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.7;
  scroll-behavior: smooth;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: calc(var(--nav-height) + 2rem) 2rem 2rem 2rem;
}

/* =========================================
   3. GLASSMORPHISM NAVIGATION
   ========================================= */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--nav-height);
  background-color: rgba(10, 15, 22, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2.5rem;
}

nav a {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1rem;
  transition: color 0.3s ease;
}

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

/* =========================================
   4. TYPOGRAPHY & HEADINGS
   ========================================= */
#titleContainer {
  text-align: center;
  margin-bottom: 3rem;
}

#titleLine {
  font-size: 3.5rem;
  color: var(--text-main);
  letter-spacing: -1px;
}

#titleLine::after {
  content: '.';
  color: var(--accent-cyan);
}

.centered-title, #current_projects_title, #portaits, #current_react_projects {
  text-align: center;
  color: var(--accent-cyan);
  font-size: 2rem;
  margin: 3rem 0 1.5rem 0;
  font-weight: 600;
}

p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  text-align: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* =========================================
   5. CSS GRID: PROJECTS 
   ========================================= */
#recent_projects_wrapper, #clientGalleryGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  padding: 1rem 0;
  justify-items: center;
}

/* Modern Card Styling */
.recproj {
  background-color: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 500px;
}

.recproj:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4), 0 0 15px var(--accent-glow);
}

.recproj img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.recproj p {
  color: var(--text-main);
  font-weight: 600;
  margin: 1rem 0;
  font-size: 1.2rem;
}

/* =========================================
   5B. FLEXBOX: ABOUT ME GALLERY (No Cropping)
   ========================================= */
.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  padding: 1rem 0;
}

.gallery-grid .image-container {
  height: 400px; /* Forces all images to be the exact same height */
  width: auto;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-grid .image-container:hover {
  transform: translateY(-5px);
}

.gallery-grid .image-container img {
  height: 100%;
  width: auto; /* Shrinks the width proportionally */
  object-fit: contain; /* Prevents ANY cropping */
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: block;
}

/* =========================================
   6. BUTTONS & LINKS
   ========================================= */
a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: text-shadow 0.3s ease;
}

a:hover {
  text-shadow: 0 0 8px var(--accent-glow);
}

#reactBtn {
  background-color: transparent;
  color: var(--accent-cyan);
  border: 2px solid var(--accent-cyan);
  padding: 1rem 2rem;
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

#reactBtn:hover {
  background-color: var(--accent-cyan);
  color: var(--bg-primary);
  box-shadow: 0 0 15px var(--accent-glow);
}

/* Resume PDF Container */
#pdfContainer {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
  width: 100%;
  height: 80vh;
}

#pdfContainer embed {
  width: 100%;
  height: 100%;
  max-width: 1000px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Fade - In of Divs on scroll */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.5s ease-out, transform 1s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================
   7. YOUTUBE CAROUSEL OVERRIDES
   ========================================= */
.yt-carousel { position: relative; width: 100%; overflow: hidden; margin: 1.5rem 0; }
.yt-track { display: flex; transition: transform 0.6s ease; }
.yt-slide { padding: 0.5rem; box-sizing: border-box; }
.yt-slide iframe { width: 100%; height: 260px; max-width: none; border-radius: 8px; }
.yt-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(10, 15, 22, 0.8); color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan); padding: 0.5rem 1rem;
  cursor: pointer; font-size: 2rem; border-radius: 6px; transition: all 0.3s ease;
  z-index: 10;
}
.yt-nav:hover { background: var(--accent-cyan); color: var(--bg-primary); }
.yt-left { left: 8px; }
.yt-right { right: 8px; }
.yt-nav:disabled { opacity: 0.2; cursor: default; }

/* =========================================
   8. FOOTER
   ========================================= */
footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 4rem;
}

#copyright {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 1rem 0 0 0;
}

/* =========================================
   9. RESPONSIVE DESIGN (Mobile)
   ========================================= */
@media (max-width: 768px) {
  nav ul { gap: 1rem; font-size: 0.9rem; }
  #titleLine { font-size: 2.5rem; }
  .yt-slide iframe{ height: 220px; }
  #recent_projects_wrapper, #clientGalleryGrid {
    grid-template-columns: 1fr;
  }
}

/* =========================================
   10. NAVBAR UTILITY CONTROLS (Theme & Lang)
   ========================================= */
.nav-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-left: 2rem; /* Separates it from the main links */
}

.utility-btn {
  background: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-main);
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.utility-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

@media (max-width: 768px) {
  .nav-controls {
    margin-left: 0;
    margin-top: 1rem;
  }
}