/* ===============================
   Root Variables (Theme Colors)
================================== */
:root {
  --primary-blue: #0a66c2;
  --accent-red: #e63946;
  --light-white: #f8f9fa;
  --dark-blue: #1d3557;

  /* Header and section backgrounds */
  --header-bg-gradient: linear-gradient(120deg, var(--primary-blue), var(--accent-red));
  --section-bg: white;
  --footer-bg: #ececec;
  --footer-text: #666;
  --link-bg: var(--dark-blue);
  --link-hover-bg: var(--accent-red);
}

/* Dark mode overrides */
[data-theme="dark"] {
  --primary-blue: #6394f8;
  --accent-red: #f0717f;
  --light-white: #121212;
  --dark-blue: #e0e0e0;

  --header-bg-gradient: linear-gradient(120deg, #274472, #a3464a);
  --section-bg: #1e1e1e;
  --footer-bg: #222;
  --footer-text: #bbb;
  --link-bg: #274472;
  --link-hover-bg: #f0717f;
}

/* ===============================
   Global Styles
================================== */
body {
  font-family: 'Rubik', sans-serif;
  margin: 0;
  padding: 0;
  background: var(--light-white);
  color: var(--dark-blue);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

/* ===============================
   Typography
================================== */
h2 {
  font-size: 1.5rem;
  color: var(--primary-blue);
  margin-bottom: 1rem;
}

blockquote {
  font-style: italic;
  color: var(--accent-red);
  margin: 1rem 0 0;
  border-left: 4px solid var(--primary-blue);
  padding-left: 1rem;
}

/* ===============================
   Header
================================== */
header {
  background: var(--header-bg-gradient);
  color: white;
  text-align: center;
  padding: 3rem 1rem;
  clip-path: polygon(0 0, 100% 0, 100% 85%, 0% 100%);
  transition: background-color 0.3s ease;
}

header img {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid white;
  margin-bottom: 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

header h1 {
  margin: 0;
  font-size: 3rem;
  font-weight: 600;
}

header p {
  font-size: 1.2rem;
  margin-top: 0.5rem;
}

/* Dark mode toggle button */
#theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: none;
  border: 2px solid var(--dark-blue);
  border-radius: 6px;
  color: var(--dark-blue);
  padding: 0.3rem 0.6rem;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  z-index: 1000;
}

#theme-toggle:hover {
  background-color: var(--dark-blue);
  color: var(--light-white);
  border-color: var(--light-white);
}

/* ===============================
   Main Layout
================================== */
main {
  max-width: 900px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

section {
  margin-bottom: 3rem;
  background: var(--section-bg);
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
  border-left: 8px solid var(--accent-red);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===============================
   Footer
================================== */
footer {
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  font-size: 0.9rem;
  background: var(--footer-bg);
  color: var(--footer-text);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===============================
   Project Links Section
================================== */
.projects .project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.projects .project-links a {
  flex: 1 1 200px;
  text-align: center;
  background: var(--link-bg);
  color: white;
  text-decoration: none;
  padding: 1rem;
  border-radius: 12px;
  font-weight: bold;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, background 0.3s ease;
}

.projects .project-links a:hover {
  background: var(--link-hover-bg);
  transform: translateY(-3px);
}

/* ===============================
   External Links Section (Connect With Me)
================================== */
.links a {
  display: inline-block;
  background: var(--primary-blue);
  color: white;
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  margin: 0.3rem 0.5rem 0 0;
  border-radius: 8px;
  transition: background 0.3s ease;
}

.links a:hover {
  background: var(--accent-red);
}

/* ===============================
   YouTube Feed
================================== */
.youtube-feed {
  padding: 2rem;
  text-align: center;
}

#video-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

iframe {
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* ===============================
   Image Gallery
================================== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  grid-auto-rows: 200px;
  gap: 10px;
  padding: 20px;
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.gallery img:hover {
  transform: scale(1.05);
  z-index: 2;
}

/* ===============================
   Media Queries (Responsive Tweaks)
================================== */
@media (max-width: 600px) {
  header h1 {
    font-size: 2.2rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  main {
    padding: 0 1rem;
  }

  .projects .project-links a {
    padding: 0.75rem;
    font-size: 0.95rem;
  }
}

/* ===============================
   Page Dropdown Navigation
================================== */
.page-selector {
  text-align: center;
  margin: 2rem 0;
}

.page-selector label {
  font-weight: bold;
  margin-right: 0.5rem;
  color: var(--dark-blue);
}

.page-selector select {
  padding: 0.6rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--primary-blue);
  border-radius: 8px;
  background-color: white;
  color: var(--dark-blue);
  cursor: pointer;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.page-selector select:hover,
.page-selector select:focus {
  border-color: var(--accent-red);
  box-shadow: 0 0 5px rgba(230, 57, 70, 0.4);
}

/* Dark mode styles for dropdown navigation */
[data-theme="dark"] .page-selector label {
  color: var(--dark-blue);
}

[data-theme="dark"] .page-selector select {
  background-color: var(--section-bg);
  color: var(--dark-blue);
  border-color: var(--primary-blue);
}

[data-theme="dark"] .page-selector select:hover,
[data-theme="dark"] .page-selector select:focus {
  border-color: var(--accent-red);
  box-shadow: 0 0 5px rgba(240, 113, 127, 0.6);
}
