/* ========================================
   Modern Dark Theme - Tokyo Student Guide
   ======================================== */

/* ========================================
   CSS Reset & Base Styles
   ======================================== */

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

/* Screen reader only text */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border-width: 0 !important;
}

html {
  height: 100%;
  min-height: 100%;
  background-color: #0a0e27;
  margin: 0;
  padding: 0;
  overflow-y: scroll;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0 0 0 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter",
    "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: #e2e8f0;
  background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  min-height: 100vh;
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  position: relative;
}

/* ========================================
   Typography
   ======================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 1.2rem 0;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 2.5rem;
  background: linear-gradient(135deg, #00d9ff 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 2rem;
  margin-top: 3rem;
  color: #ffffff;
}

h3 {
  font-size: 1.5rem;
  margin-top: 2rem;
  background: linear-gradient(135deg, #00d9ff 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h4 {
  font-size: 1.25rem;
  color: #00d9ff;
}

p {
  margin: 0 0 1.2rem 0;
  color: #cbd5e1;
}

a {
  color: #00d9ff;
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: #7c3aed;
  text-decoration: none;
}

a:focus {
  outline: 2px solid #00d9ff;
  outline-offset: 3px;
  border-radius: 2px;
}

ul,
ol {
  margin: 0 0 1.5rem 0;
  padding-left: 1.5rem;
  color: #cbd5e1;
}

li {
  margin-bottom: 0.7rem;
}

strong {
  font-weight: 600;
  color: #ffffff;
}

code {
  background: rgba(0, 217, 255, 0.1);
  color: #00d9ff;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-family: "Fira Code", "Courier New", monospace;
  font-size: 0.9em;
  border: 1px solid rgba(0, 217, 255, 0.2);
}

/* ========================================
   Layout & Container
   ======================================== */

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

/* ========================================
   Header
   ======================================== */

header {
  background: linear-gradient(
    135deg,
    rgba(0, 217, 255, 0.1) 0%,
    rgba(124, 58, 237, 0.1) 100%
  );
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3rem 0 2.5rem 0;
  text-align: center;
}

header h1 {
  margin-bottom: 0.5rem;
  font-size: 3rem;
  font-weight: 800;
}

header .tagline {
  font-size: 1.3rem;
  margin: 0;
  color: #94a3b8;
  font-weight: 300;
}

/* ========================================
   Navigation
   ======================================== */

nav {
  background: rgba(21, 25, 50, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

nav .container {
  padding: 0;
  position: relative;
}

/* Hide the checkbox */
.nav-toggle {
  display: none;
}

/* Burger menu icon - hidden on desktop */
.nav-toggle-label {
  display: none;
  position: absolute;
  top: 0;
  right: 1rem;
  height: 56px;
  align-items: center;
  padding: 0 1rem;
  cursor: pointer;
  z-index: 101;
}

.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  display: block;
  background: #00d9ff;
  height: 3px;
  width: 28px;
  border-radius: 3px;
  position: relative;
  transition: all 0.3s ease;
}

.nav-toggle-label span::before,
.nav-toggle-label span::after {
  content: "";
  position: absolute;
}

.nav-toggle-label span::before {
  top: -8px;
}

.nav-toggle-label span::after {
  top: 8px;
}

/* Animate burger icon to X when checked */
.nav-toggle:checked ~ .nav-toggle-label span {
  background: transparent;
}

.nav-toggle:checked ~ .nav-toggle-label span::before {
  transform: rotate(45deg);
  top: 0;
  background: #7c3aed;
}

.nav-toggle:checked ~ .nav-toggle-label span::after {
  transform: rotate(-45deg);
  top: 0;
  background: #7c3aed;
}

/* Navigation list */
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-list li {
  margin: 0;
}

.nav-list a {
  display: block;
  padding: 1.1rem 1.5rem;
  color: #94a3b8;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

.nav-list a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #00d9ff 0%, #7c3aed 100%);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-list a:hover {
  color: #00d9ff;
  background: rgba(0, 217, 255, 0.05);
}

.nav-list a:hover::after {
  width: 80%;
}

.nav-list a:focus {
  outline: 2px solid #00d9ff;
  outline-offset: -2px;
}

.nav-list a.active {
  color: #ffffff;
  background: rgba(0, 217, 255, 0.1);
  font-weight: 600;
}

.nav-list a.active::after {
  width: 80%;
}

/* ========================================
   Main Content
   ======================================== */

main {
  padding: 4rem 0;
  min-height: 60vh;
}

.page-intro {
  margin-bottom: 3rem;
  padding: 2rem;
  background: rgba(21, 25, 50, 0.5);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.page-intro h2 {
  margin-top: 0;
}

section {
  margin-bottom: 4rem;
}

/* ========================================
   Cards & Grid Layout
   ======================================== */

.card {
  background: linear-gradient(
    135deg,
    rgba(21, 25, 50, 0.8) 0%,
    rgba(26, 31, 58, 0.8) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: all 0.4s ease;
  backdrop-filter: blur(10px);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 48px rgba(0, 217, 255, 0.2);
  border-color: rgba(0, 217, 255, 0.3);
}

.card h3 {
  margin-top: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2.5rem;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
  display: inline-block;
  padding: 0.9rem 2rem;
  background: linear-gradient(135deg, #00d9ff 0%, #7c3aed 100%);
  color: #ffffff;
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(0, 217, 255, 0.3);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 217, 255, 0.5);
  text-decoration: none;
}

.btn:focus {
  outline: 2px solid #00d9ff;
  outline-offset: 3px;
}

.btn-primary {
  background: linear-gradient(135deg, #00d9ff 0%, #7c3aed 100%);
}

.btn-secondary {
  background: rgba(148, 163, 184, 0.2);
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(148, 163, 184, 0.3);
  border-color: rgba(148, 163, 184, 0.5);
}

/* ========================================
   Hero & CTA Sections
   ======================================== */

.hero {
  background: linear-gradient(
    135deg,
    rgba(0, 217, 255, 0.1) 0%,
    rgba(124, 58, 237, 0.1) 100%
  );
  padding: 3rem;
  border-radius: 20px;
  border-left: 4px solid #00d9ff;
  margin-bottom: 3rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.hero h2 {
  margin-top: 0;
}

.cta-section {
  background: linear-gradient(
    135deg,
    rgba(0, 217, 255, 0.15) 0%,
    rgba(124, 58, 237, 0.15) 100%
  );
  padding: 3rem;
  border-radius: 20px;
  text-align: center;
  border: 1px solid rgba(0, 217, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.cta-section h2 {
  margin-top: 0;
}

/* ========================================
   Tips Boxes
   ======================================== */

.tips-box {
  background: linear-gradient(
    135deg,
    rgba(124, 58, 237, 0.1) 0%,
    rgba(0, 217, 255, 0.1) 100%
  );
  border-left: 4px solid #7c3aed;
  padding: 2rem;
  margin: 2rem 0;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.tips-box h4 {
  margin-top: 0;
  color: #7c3aed;
}

.tips-box ul {
  margin-bottom: 0;
}

/* ========================================
   Itinerary Styles
   ======================================== */

.itinerary-day {
  border-left: 4px solid #00d9ff;
  background: linear-gradient(
    135deg,
    rgba(0, 217, 255, 0.05) 0%,
    rgba(124, 58, 237, 0.05) 100%
  );
}

.itinerary-note {
  font-style: italic;
  color: #94a3b8;
  margin-top: 2rem;
  padding: 1rem;
  background: rgba(0, 217, 255, 0.05);
  border-radius: 8px;
}

/* ========================================
   Tables
   ======================================== */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: rgba(21, 25, 50, 0.5);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

table th,
table td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

table th {
  background: linear-gradient(
    135deg,
    rgba(0, 217, 255, 0.2) 0%,
    rgba(124, 58, 237, 0.2) 100%
  );
  color: #ffffff;
  font-weight: 600;
}

table tbody tr {
  transition: all 0.3s ease;
}

table tbody tr:hover {
  background: rgba(0, 217, 255, 0.05);
}

.budget-table td:last-child,
.budget-table th:last-child {
  text-align: right;
}

/* ========================================
   Gallery
   ======================================== */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
  margin-top: 3rem;
}

.gallery-item {
  margin: 0;
  background: rgba(21, 25, 50, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: all 0.4s ease;
}

.gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 48px rgba(0, 217, 255, 0.3);
  border-color: rgba(0, 217, 255, 0.3);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 280px;
  max-height: 280px;
  object-fit: cover;
  display: block;
  background: linear-gradient(
    135deg,
    rgba(21, 25, 50, 0.8) 0%,
    rgba(0, 217, 255, 0.1) 100%
  );
  transition: all 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item figcaption {
  padding: 1.5rem;
  font-size: 0.95rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.gallery-note {
  background: rgba(0, 217, 255, 0.1);
  padding: 2rem;
  border-radius: 12px;
  margin-top: 3rem;
  border: 1px solid rgba(0, 217, 255, 0.2);
}

/* ========================================
   Contact Form
   ======================================== */

.contact-form-section {
  max-width: 800px;
  margin: 3rem auto;
}

.contact-form {
  background: rgba(21, 25, 50, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 3rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.contact-form fieldset {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  background: rgba(0, 0, 0, 0.2);
}

.contact-form legend {
  font-weight: 600;
  font-size: 1.3rem;
  color: #00d9ff;
  padding: 0 1rem;
}

.fieldset-description {
  margin-top: 0;
  color: #94a3b8;
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 1.8rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.7rem;
  color: #ffffff;
}

.required {
  color: #ff6b9d;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: rgba(0, 0, 0, 0.3);
  color: #ffffff;
  transition: all 0.3s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #64748b;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #00d9ff;
  box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.2);
  background: rgba(0, 0, 0, 0.4);
}

.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
}

.checkbox-item input[type="checkbox"] {
  margin-right: 0.7rem;
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #00d9ff;
}

.checkbox-item label {
  margin-bottom: 0;
  font-weight: 400;
  cursor: pointer;
  color: #cbd5e1;
}

.form-actions {
  display: flex;
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.contact-info {
  max-width: 800px;
  margin: 3rem auto;
  padding: 2rem;
  background: rgba(21, 25, 50, 0.5);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-info h3 {
  margin-top: 0;
}

/* ========================================
   Footer
   ======================================== */

footer {
  background: rgba(21, 25, 50, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 2rem 0;
  text-align: center;
  margin-top: 5rem;
  margin-bottom: 0;
  position: relative;
}

footer p {
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
}

footer a {
  color: #00d9ff;
}

/* ========================================
   Responsive Design (Mobile)
   ======================================== */

@media (max-width: 768px) {
  body {
    font-size: 15px;
  }

  header {
    padding: 2rem 0 1.5rem 0;
  }

  header h1 {
    font-size: 2rem;
  }

  header .tagline {
    font-size: 1.1rem;
  }

  /* Ensure nav has minimum height for burger icon */
  nav .container {
    min-height: 56px;
  }

  /* Show burger menu icon */
  .nav-toggle-label {
    display: flex;
  }

  /* Hide navigation list by default */
  .nav-list {
    position: absolute;
    top: 56px;
    left: 0;
    width: 100%;
    background: rgba(21, 25, 50, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-start;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* Force list items to full width immediately */
  .nav-list li {
    width: 100%;
    flex: 0 0 auto;
  }

  .nav-list a {
    width: 100%;
    text-align: center;
    padding: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .nav-list a::after {
    display: none;
  }

  .nav-list li:last-child a {
    border-bottom: none;
  }

  /* Show navigation when checkbox is checked */
  .nav-toggle:checked ~ .nav-list {
    max-height: 500px;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.6rem;
  }

  h3 {
    font-size: 1.3rem;
  }

  .container {
    padding: 0 1.5rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .checkbox-group {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  table {
    font-size: 0.9rem;
  }

  table th,
  table td {
    padding: 0.7rem;
  }

  .hero,
  .cta-section {
    padding: 2rem;
  }

  .tips-box {
    padding: 1.5rem;
  }

  .contact-form {
    padding: 2rem;
  }

  .contact-form fieldset {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.75rem;
  }

  .hero,
  .cta-section,
  .tips-box {
    padding: 1.5rem;
  }

  .contact-form {
    padding: 1.5rem;
  }

  .contact-form fieldset {
    padding: 1.25rem;
  }

  .card {
    padding: 1.5rem;
  }
}
