/* Base styles */
body {
  font-family: 'Poppins', sans-serif; /* Modern font from Google */
  background-color: #f0f2f5; /* Subtle off-white background */
  margin: 0;
  padding: 0;
  color: #333;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark Mode styles */
body.dark-mode {
  background-color: #121212; /* Dark background */
  color: #f5f5f5; /* Light text for contrast */
}

/* Hero Section Styling */
.hero {
  text-align: center;
  padding: 50px 20px;
  background: linear-gradient(to right, #4CAF50, #8BC34A);
  color: white;
}

.hero h1 {
  font-size: 3em;
  margin: 0;
}

.hero p {
  font-size: 1.5em;
}

/* Header and Main Title */
h1 {
  text-align: center;
  margin-top: 50px;
  font-size: 3em;
  font-weight: 700;
  color: #222;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

/* Dark Mode for headings */
body.dark-mode h1, 
body.dark-mode h2 {
  color: #f5f5f5; /* Lighter color for headings in dark mode */
}

/* Subheading for Sections */
h2 {
  margin-top: 50px;
  text-align: center;
  color: #555;
  font-size: 2em;
  font-weight: 600;
}

/* Global margin/padding adjustments */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Toggle Container */
.toggle-container {
  position: sticky;
  top: 0; /* Stick to the top of the viewport */
  background: #f0f2f5; /* Match background color */
  padding: 10px 0;
  z-index: 100; /* Ensure it stays on top of other elements */
  text-align: center; /* Center the toggle */
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
  margin: 0 10px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* Slider */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px; /* Rounded edges */
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%; /* Circle for the toggle */
}

/* Checked Slider */
input:checked + .slider {
  background-color: #4CAF50; /* Green when toggled */
}

input:checked + .slider:before {
  transform: translateX(26px); /* Move the toggle to the right */
}

/* Toggle Labels */
.toggle-label {
  margin: 0 10px;
  position: relative;
  color: #555; /* Default color */
}

/* Dark mode toggle label colors */
body.dark-mode .toggle-label {
  color: #f5f5f5; /* Lighter color for toggle labels in dark mode */
}

/* Gallery styling */
.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 30px; /* Increased gap for better spacing */
  justify-content: center;
  margin: 60px 0;
}

.gallery img {
  width: 100%;
  max-width: 400px; /* Increased max-width for larger images on bigger screens */
  border-radius: 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0px 8px 30px rgba(0, 0, 0, 0.15); /* Initial subtle shadow */
}

/* Dark mode image shadows */
body.dark-mode .gallery img {
  box-shadow: 0px 8px 30px rgba(255, 255, 255, 0.15); /* Lighter shadow in dark mode */
}

.gallery img:hover {
  transform: scale(1.1); /* Slightly stronger zoom effect on hover */
  box-shadow: 0px 15px 35px rgba(0, 0, 0, 0.3); /* More prominent shadow on hover */
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .gallery img {
      max-width: 90vw; /* Make images take up almost the entire screen width on smaller devices */
      margin-bottom: 20px; /* Add space between images */
  }
  
  h1 {
      font-size: 2.2em; /* Adjust title size for mobile */
  }
  
  h2 {
      font-size: 1.5em; /* Adjust section title size for mobile */
  }
}

@media (max-width: 480px) {
  .gallery img {
      max-width: 100vw; /* On very small screens, use full width */
      border-radius: 10px; /* Adjust border radius for smaller screens */
  }
}

/* Button styles */
button {
  background-color: #007bff;
  color: white;
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  font-size: 1.2em;
  cursor: pointer;
  box-shadow: 0px 4px 12px rgba(0, 123, 255, 0.2);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Button dark mode */
body.dark-mode button {
  background-color: #444;
  color: #f5f5f5;
  box-shadow: 0px 4px 12px rgba(255, 255, 255, 0.2); /* Adjust shadow for dark mode */
}

button:hover {
  background-color: #0056b3;
  box-shadow: 0px 6px 16px rgba(0, 86, 179, 0.3); /* Subtle shadow on hover */
}

/* Hide the cursor character for the Typed.js animation */
#typed-text {
  display: inline; /* Ensures text doesn't stack */
}

.typed-cursor {
  display: none; /* Hide the cursor */
}

.fade-in {
  opacity: 0;
  animation: fadeIn 2s forwards;
}

@keyframes fadeIn {
  from {
      opacity: 0;
  }
  to {
      opacity: 1;
  }
}

html {
  scroll-behavior: smooth;
}

/* Navigation Bar */
.navbar {
  background-color: #4CAF50;
  overflow: hidden;
  padding: 10px 0;
}

.navbar ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
}

.navbar li {
  display: inline;
  margin: 0 20px;
}

.navbar a {
  color: white;
  text-align: center;
  padding: 14px 20px;
  text-decoration: none;
  font-size: 1.2em;
  display: inline-block;
}

.navbar a:hover {
  background-color: #45a049;
  color: white;
}
/* Container for centering the grid */
.hiragana-grid-wrapper {
  display: flex;
  justify-content: center; /* Center the grid horizontally */
  padding: 20px;
  width: 100%; /* Ensure the wrapper takes the full width of the screen */
}

/* Hiragana Grid Layout */
.hiragana-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 equally spaced columns */
  gap: 20px;
  max-width: 1200px; /* Optional: Limit grid width on large screens */
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
}

/* Hiragana Item Image Styling */
.hiragana-item img {
  width: 100%; /* Fill the grid column */
  height: auto;
  max-width: 300px; /* Increase the max size of each image */
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Adjust for smaller screens */
@media (max-width: 768px) {
  .hiragana-grid {
      grid-template-columns: repeat(2, 1fr); /* Switch to 2 columns on smaller screens */
  }
}

@media (max-width: 480px) {
  .hiragana-grid {
      grid-template-columns: 1fr; /* Switch to 1 column on very small screens */
  }
}


/* Dark mode image shadows */
body.dark-mode .hiragana-item img {
    box-shadow: 0px 8px 30px rgba(255, 255, 255, 0.15);
}


/* Katakana Grid Layout */
.katakana-grid-wrapper {
  display: flex;
  justify-content: center; /* Center the grid horizontally */
  padding: 20px;
  width: 100%; /* Ensure the wrapper takes the full width of the screen */
}

.katakana-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 equally spaced columns */
  gap: 20px;
  max-width: 1200px; /* Optional: Limit grid width on large screens */
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
}

.katakana-item img {
  width: 100%; /* Fill the grid column */
  height: auto;
  max-width: 300px; /* Increase the max size of each image */
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Adjust for smaller screens */
@media (max-width: 768px) {
  .katakana-grid {
      grid-template-columns: repeat(2, 1fr); /* Switch to 2 columns on smaller screens */
  }
}

@media (max-width: 480px) {
  .katakana-grid {
      grid-template-columns: 1fr; /* Switch to 1 column on very small screens */
  }
}

/* Dark mode image shadows */
body.dark-mode .katakana-item img {
    box-shadow: 0px 8px 30px rgba(255, 255, 255, 0.15);
}
/* Container for centering the grid */
.greetings-grid-wrapper {
  display: flex;
  justify-content: center; /* Center the grid horizontally */
  padding: 20px;
  width: 100%; /* Ensure the wrapper takes the full width of the screen */
}

/* Greetings Grid Layout */
.greetings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 equally spaced columns */
  gap: 20px;
  max-width: 1200px; /* Optional: Limit grid width on large screens */
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
}

/* Greetings Item Image Styling */
.greetings-item img {
  width: 100%; /* Fill the grid column */
  height: auto;
  max-width: 300px; /* Max size of each image */
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Adjust for smaller screens */
@media (max-width: 768px) {
  .greetings-grid {
      grid-template-columns: repeat(2, 1fr); /* Switch to 2 columns on smaller screens */
  }
}

@media (max-width: 480px) {
  .greetings-grid {
      grid-template-columns: 1fr; /* Switch to 1 column on very small screens */
  }
}
