/* ==============================================
   MODERN RESPONSIVE WEBSITE - MOBILE FIRST
   Fresh redesign with clean collapsible menu
   ============================================== */

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

html, body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  color: #1e293b;
  background-color: #f8fafc;
  line-height: 1.6;
  min-height: 100vh;
}

/* ==============================================
   HEADER & NAVIGATION
   ============================================== */

header {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

/* Site Logo/Title */
.site-title {
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  z-index: 1001;
  transition: opacity 0.2s ease;
}

.site-title:hover {
  opacity: 0.9;
}

/* Hamburger Menu Button (Mobile) */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
  transition: all 0.3s ease;
}

.hamburger:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.hamburger span {
  width: 100%;
  height: 3px;
  background: white;
  border-radius: 3px;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Animated hamburger to X */
.hamburger.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-100%);
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Navigation Links Container */
.nav-links {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 100%);
  flex-direction: column;
  padding: 0;
  margin: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
}

.nav-links.open {
  display: flex;
  max-height: 500px;
  padding: 1rem 0;
}

.nav-links a {
  color: white;
  text-decoration: none;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  display: block;
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.1);
  border-left-color: #60a5fa;
  padding-left: 1.75rem;
}

.nav-links a:active {
  background: rgba(255, 255, 255, 0.15);
}

/* Active page indicator */
.nav-links a.active {
  background: rgba(255, 255, 255, 0.15);
  border-left-color: #93c5fd;
}

/* ==============================================
   DESKTOP STYLES (min-width: 1400px)
   ============================================== */

@media (min-width: 1400px) {
  nav {
    padding: 1rem 2rem;
  }

  .site-title {
    font-size: 1.5rem;
  }

  /* Hide hamburger on desktop */
  .hamburger {
    display: none;
  }

  /* Show navigation links horizontally */
  .nav-links {
    display: flex;
    position: static;
    flex-direction: row;
    background: transparent;
    box-shadow: none;
    max-height: none;
    padding: 0;
    gap: 0.5rem;
    overflow: visible;
  }

  .nav-links a {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border-left: none;
    font-size: 0.95rem;
  }

  .nav-links a:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    padding-left: 1rem;
  }

  .nav-links a.active {
    background: rgba(255, 255, 255, 0.2);
    border-left: none;
  }
}

@media (min-width: 1024px) {
  .nav-links {
    gap: 0.75rem;
  }

  .nav-links a {
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
  }
}

/* ==============================================
   MAIN CONTENT
   ============================================== */

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  min-height: calc(100vh - 200px);
}

@media (min-width: 768px) {
  main {
    padding: 3rem 2rem;
  }
}

/* Profile Section (Home Page) */
.profile-section {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.profile-image {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1.5rem;
  border: 4px solid #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.profile-section h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.75rem;
}

.profile-section .subtitle {
  font-size: 1.25rem;
  color: #475569;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.profile-section p {
  font-size: 1rem;
  color: #64748b;
  line-height: 1.8;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .profile-image {
    width: 200px;
    height: 200px;
  }

  .profile-section h1 {
    font-size: 2.5rem;
  }

  .profile-section .subtitle {
    font-size: 1.5rem;
  }

  .profile-section p {
    font-size: 1.125rem;
  }
}

/* Content Sections */
.content-section {
  max-width: 900px;
}

.content-section h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 1.5rem;
  border-bottom: 3px solid #3b82f6;
  padding-bottom: 0.5rem;
}

.content-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #334155;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.content-section h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #475569;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.content-section p {
  margin-bottom: 1rem;
  color: #475569;
  line-height: 1.8;
}

.content-section ul {
  margin: 1rem 0 1rem 1.5rem;
  color: #475569;
}

.content-section li {
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

.content-section a {
  color: #3b82f6;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.content-section a:hover {
  color: #2563eb;
}

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

footer {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: white;
  text-align: center;
  padding: 2rem 1rem;
  margin-top: auto;
}

footer p {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* ==============================================
   BUTTONS & INTERACTIVE ELEMENTS
   ============================================== */

/* Primary button styles - ensure white text on blue backgrounds */
button,
input[type="submit"],
input[type="button"],
.btn,
a.btn {
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Blue buttons with white text */
button[style*="background: #3b82f6"],
button[style*="background:#3b82f6"],
a[style*="background: #3b82f6"],
a[style*="background:#3b82f6"],
.btn-primary {
  color: white !important;
  background: #3b82f6 !important;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
}

button[style*="background: #3b82f6"]:hover,
button[style*="background:#3b82f6"]:hover,
a[style*="background: #3b82f6"]:hover,
a[style*="background:#3b82f6"]:hover,
.btn-primary:hover {
  background: #2563eb !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Form submit buttons */
form button[type="submit"],
form input[type="submit"] {
  background: #3b82f6;
  color: white !important;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

form button[type="submit"]:hover,
form input[type="submit"]:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Project links and action buttons */
.project-link {
  background: #3b82f6;
  color: white !important;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-block;
}

.project-link:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  color: white !important;
}

/* ==============================================
   UTILITY CLASSES
   ============================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .container {
    padding: 0 2rem;
  }
}

.text-center {
  text-align: center;
}

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1rem; }

/* ==============================================
   ACCESSIBILITY
   ============================================== */

/* Focus visible for keyboard navigation */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #3b82f6;
  color: white;
  padding: 0.5rem 1rem;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==============================================
   IMAGE LIGHTBOX (FULLSCREEN VIEWER)
   ============================================== */

.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  display: flex;
  opacity: 1;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.lightbox-image {
  max-width: 100%;
  max-height: calc(90vh - 100px);
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  background: rgba(255, 255, 255, 0.95);
  color: #1e293b;
  padding: 1rem 1.5rem;
  margin-top: 1rem;
  border-radius: 0.5rem;
  max-width: 90vw;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.6;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  color: #1e293b;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10001;
}

.lightbox-close:hover {
  background: white;
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.lightbox-close:active {
  transform: scale(0.95);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .lightbox-content {
    max-width: 95vw;
    max-height: 95vh;
  }

  .lightbox-image {
    max-height: calc(95vh - 120px);
  }

  .lightbox-caption {
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    max-width: 95vw;
  }

  .lightbox-close {
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    font-size: 1.75rem;
  }
}

/* Indicate images are clickable */
main img,
.content-section img,
.project-figures img,
.profile-image {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

main img:hover,
.content-section img:hover,
.project-figures img:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* ==============================================
   PRINT STYLES
   ============================================== */

@media print {
  header,
  footer,
  .hamburger,
  .lightbox {
    display: none;
  }

  main {
    max-width: 100%;
  }
}
