/* ==========================================
   SyntaxSnafu Website - Main Stylesheet
   ==========================================
   Customization Points:
   - Change --primary-color and --secondary-color to update the theme gradient
   - Adjust --font-family for different typography
   - Modify --max-width for layout width
   - Dark mode is default; toggle with theme switcher button
   ========================================== */

/* CSS Variables (Theme Colors) - Dark Mode Default */
:root {
  --primary-color: #a78bfa;
  --secondary-color: #f472b6;
  --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  --text-color: #f3f4f6;
  --text-light: #9ca3af;
  --bg-color: #111827;
  --bg-secondary: #1f2937;
  --border-color: #374151;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width: 1200px;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --transition: all 0.3s ease;
  --code-bg: #0d1117;
  --focus-ring: rgba(167, 139, 250, 0.3);
}

/* Light Mode Theme */
[data-theme="light"] {
  --primary-color: #8b5cf6;
  --secondary-color: #ec4899;
  --text-color: #1f2937;
  --text-light: #6b7280;
  --bg-color: #ffffff;
  --bg-secondary: #f9fafb;
  --border-color: #e5e7eb;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --code-bg: #f1f5f9;
  --focus-ring: rgba(139, 92, 246, 0.2);
}

/* Reset & Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--secondary-color);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================
   Header & Navigation
   ========================================== */
.header {
  background: var(--bg-color);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.header nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-list {
  display: flex;
  gap: 2rem;
}

.nav-list a {
  color: var(--text-color);
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
}

.nav-list a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  transition: var(--transition);
}

.nav-list a:hover::after,
.nav-list a.active::after {
  width: 100%;
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 0.5rem;
  background: transparent;
  border: none;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--text-color);
  border-radius: 3px;
  transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Theme Toggle Button */
.theme-toggle {
  background: transparent;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--primary-color);
  background: var(--bg-secondary);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  display: none;
}

/* Dark mode (default) - show sun icon */
.theme-toggle .icon-sun {
  display: block;
}

/* Light mode - show moon icon */
[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

/* ==========================================
   Main Content
   ========================================== */
main {
  flex: 1;
}

/* Hero Section */
.hero {
  background: var(--gradient);
  color: white;
  padding: 6rem 0;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
}

.hero p {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* Portfolio Hero with Background Image */
.portfolio-hero {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 6rem 0;
  text-align: center;
  color: white;
}

.portfolio-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, var(--overlay-alpha, 0.5));
  z-index: 1;
}

.portfolio-hero .container {
  position: relative;
  z-index: 2;
}

.portfolio-hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.portfolio-hero .game-date {
  font-size: 1.25rem;
  opacity: 0.9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.portfolio-hero .game-jam-badge {
  margin-top: 1rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background: white;
  color: var(--primary-color);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: var(--secondary-color);
}

.btn-gradient {
  background: var(--gradient);
  color: white;
}

.btn-gradient:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
}

/* Section Styles */
.section {
  padding: 5rem 0;
}

.section-alt {
  background: var(--bg-secondary);
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title h2 {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ==========================================
   Cards & Grid
   ========================================== */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.card {
  background: var(--bg-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.card-image {
  width: 100%;
  height: 200px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.875rem;
  flex-shrink: 0;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-content h3 {
  margin-bottom: 0.5rem;
}

.card-content p {
  color: var(--text-light);
  margin-bottom: 1rem;
}

.card-content .btn {
  margin-top: auto;
  align-self: flex-start;
}

/* Game Date Styling */
.game-date {
  font-size: 0.875rem;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

/* Game Jam Badge */
.game-jam-badge {
  display: inline-block;
  background: var(--gradient);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 0.5rem;
}

/* Game Jam Badge Link */
a.game-jam-badge {
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

a.game-jam-badge:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 4px 12px rgba(167, 139, 250, 0.4);
  filter: brightness(1.1);
  color: white;
}

/* Game Details Page Layout */
.game-details {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 3rem;
  align-items: start;
}

.game-description h2 {
  margin-bottom: 1rem;
}

.game-description h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.game-description ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.game-description li {
  list-style: disc;
  margin-bottom: 0.5rem;
}

.game-embed {
  position: sticky;
  top: 100px;
}

.game-embed .btn {
  display: block;
  margin-top: 1rem;
  text-align: center;
}

@media (max-width: 992px) {
  .game-details {
    grid-template-columns: 1fr;
  }
  
  .game-embed {
    position: static;
  }
}

/* Itch.io Embed Styling */
.itch-embed {
  margin-top: 1rem;
}

.itch-embed iframe {
  border: none;
  border-radius: var(--border-radius-sm);
  max-width: 100%;
}

/* Feature Cards */
.feature-card {
  padding: 2rem;
  text-align: center;
}

.feature-card .icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1.5rem;
  background: var(--gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
}

/* ==========================================
   Documentation Layout (PDFViewer)
   ========================================== */
.docs-layout {
  display: flex;
  gap: 2rem;
  padding: 2rem 0;
}

.docs-sidebar {
  width: 250px;
  flex-shrink: 0;
  position: sticky;
  top: 100px;
  height: fit-content;
}

.docs-sidebar nav ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.docs-sidebar nav a {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius-sm);
  color: var(--text-color);
  transition: var(--transition);
}

.docs-sidebar nav a:hover,
.docs-sidebar nav a.active {
  background: var(--bg-secondary);
  color: var(--primary-color);
}

/* Mobile docs navigation - hidden on desktop */
.docs-mobile-nav {
  display: none;
}

.docs-content {
  flex: 1;
  min-width: 0;
}

.docs-content section {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.docs-content section:last-child {
  border-bottom: none;
}

.docs-content h2 {
  margin-bottom: 1.5rem;
  padding-top: 1rem;
}

.docs-content ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.docs-content li {
  list-style: disc;
  margin-bottom: 0.5rem;
}

/* Code Blocks */
pre, code {
  font-family: 'Fira Code', 'Consolas', monospace;
  background: var(--code-bg);
  border-radius: var(--border-radius-sm);
}

code {
  padding: 0.2rem 0.4rem;
  font-size: 0.875rem;
}

pre {
  padding: 1.5rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

pre code {
  padding: 0;
  background: transparent;
}

/* Documentation Tables */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
}

.docs-table th,
.docs-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.docs-table th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-color);
}

.docs-table tr:last-child td {
  border-bottom: none;
}

.docs-table tr:hover {
  background: var(--bg-secondary);
}

.docs-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.docs-content ol li {
  list-style: decimal;
  margin-bottom: 0.5rem;
}

/* ==========================================
   About Page
   ========================================== */
.about-header {
  text-align: center;
  padding: 3rem 0;
}

.profile-image {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--gradient);
  margin: 0 auto 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 4rem;
  font-weight: 700;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.skill-tag {
  background: var(--bg-secondary);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.skill-tag:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* Contact Form */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

/* ==========================================
   Footer
   ========================================== */
.footer {
  background: var(--bg-secondary);
  color: var(--text-color);
  padding: 3rem 0 1.5rem;
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  margin-bottom: 1rem;
}

.footer-section ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-section a {
  color: var(--text-light);
}

.footer-section a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-light);
  font-size: 0.875rem;
}

/* ==========================================
   Responsive Design
   ========================================== */
@media (max-width: 992px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .docs-sidebar {
    display: none;
  }
  
  .docs-layout {
    display: block;
  }
  
  /* Mobile docs navigation - show as horizontal scroll */
  .docs-mobile-nav {
    display: block;
    overflow-x: auto;
    padding: 1rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    -webkit-overflow-scrolling: touch;
  }
  
  .docs-mobile-nav ul {
    display: flex;
    gap: 0.5rem;
    padding: 0 0.5rem;
    min-width: max-content;
  }
  
  .docs-mobile-nav a {
    display: block;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    white-space: nowrap;
    font-size: 0.875rem;
    color: var(--text-color);
  }
  
  .docs-mobile-nav a:hover,
  .docs-mobile-nav a.active {
    background: var(--primary-color);
    color: white;
  }
}

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  
  .hamburger {
    display: flex;
  }
  
  .nav-list {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--bg-color);
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    gap: 1rem;
    box-shadow: var(--shadow);
    transform: translateY(-150%);
    opacity: 0;
    transition: var(--transition);
  }
  
  .nav-list.active {
    transform: translateY(0);
    opacity: 1;
  }
  
  .hero {
    padding: 4rem 0;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  
  .section {
    padding: 3rem 0;
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-section {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }
  
  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
  }
  
  .card-content {
    padding: 1rem;
  }
}

/* ==========================================
   Animations & Utilities
   ========================================== */
.text-center {
  text-align: center;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Notification Toast */
.notification {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-secondary);
  color: var(--text-color);
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 90%;
  width: 500px;
  z-index: 2000;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.notification p {
  margin: 0;
  flex: 1;
}

.notification-close {
  background: transparent;
  border: none;
  color: var(--text-light);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: var(--transition);
}

.notification-close:hover {
  color: var(--text-color);
}
