/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700&display=swap');

/* CSS Custom Properties */
:root {
  --primary-green: #2d5f3f;
  --light-green: #4a7c5d;
  --accent-green: #5d8c70;
  --white: #ffffff;
  --light-gray: #f8f9fa;
  --medium-gray: #6c757d;
  --dark-gray: #2c2c2c;
  --shadow: 0 4px 12px rgba(45, 95, 63, 0.15);
  --shadow-hover: 0 8px 24px rgba(45, 95, 63, 0.25);
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 400;
  line-height: 1.7;
  color: var(--dark-gray);
  background-color: var(--white);
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--primary-green);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 2rem);
}

p {
  margin-bottom: 1rem;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
}

a {
  color: var(--primary-green);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--light-green);
  text-decoration: underline;
}

/* Header Styles */
.header {
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--light-green) 100%);
  color: var(--white);
  text-align: center;
  padding: 4rem 2rem;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
  opacity: 0.3;
}

.header-content {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.tagline {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 300;
  opacity: 0.9;
  margin-bottom: 2rem;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Section Styles */
.section {
  padding: 4rem 0;
}

.section:nth-child(even) {
  background-color: var(--light-gray);
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-green), var(--light-green));
  margin: 1rem auto;
  border-radius: 2px;
}

/* News Section */
.news-section {
  background: var(--white);
  border-bottom: 1px solid #e9ecef;
}

.news-item {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  border: 2px solid #f39c12;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.news-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: var(--transition);
}

.news-item:hover::before {
  left: 100%;
}

.news-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.news-badge {
  display: inline-block;
  background: #e74c3c;
  color: var(--white);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-right: 0.5rem;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.card {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-green), var(--light-green));
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.card-title {
  color: var(--primary-green);
  margin-bottom: 1rem;
}

.card-text {
  color: var(--medium-gray);
  margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--light-green) 100%);
  color: var(--white);
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  color: var(--white);
  text-decoration: none;
}

.btn-secondary {
  background: var(--white);
  color: var(--primary-green);
  border: 2px solid var(--primary-green);
}

.btn-secondary:hover {
  background: var(--primary-green);
  color: var(--white);
  text-decoration: none;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* Button Group */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Legacy Link */
.legacy-link {
  background: var(--light-gray);
  border: 1px solid #dee2e6;
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--medium-gray);
}

.legacy-link a {
  color: var(--medium-gray);
  font-weight: 500;
}

.legacy-link a:hover {
  color: var(--primary-green);
}

/* FAQ Section */
.faq-section {
  background: var(--white);
}

.faq-item {
  background: var(--white);
  border: 1px solid #e9ecef;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.faq-question {
  background: linear-gradient(135deg, var(--light-gray) 0%, #f8f9fa 100%);
  padding: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  border: none;
  width: 100%;
  text-align: left;
  font-size: 1rem;
  font-weight: 500;
  color: var(--primary-green);
}

.faq-question:hover {
  background: linear-gradient(135deg, #e9ecef 0%, var(--light-gray) 100%);
}

.faq-question::after {
  content: '+';
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  font-weight: 300;
  transition: var(--transition);
}

.faq-question.active::after {
  content: '−';
  transform: translateY(-50%) rotate(180deg);
}

.faq-answer {
  padding: 0 1.5rem;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--white);
}

.faq-answer.active {
  padding: 1.5rem;
  max-height: 500px;
}

.faq-answer p {
  margin-bottom: 0.5rem;
  color: var(--dark-gray);
  line-height: 1.6;
}

/* Rules Section */
.rules-section {
  background: var(--light-gray);
}

.rules-content {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.rules-list {
  list-style: none;
  counter-reset: rule-counter;
}

.rules-list li {
  counter-increment: rule-counter;
  margin-bottom: 1rem;
  padding-left: 3rem;
  position: relative;
}

.rules-list li::before {
  content: counter(rule-counter);
  position: absolute;
  left: 0;
  top: 0;
  background: var(--primary-green);
  color: var(--white);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 0.9rem;
}

/* Footer */
.footer {
  background: var(--dark-gray);
  color: var(--white);
  padding: 3rem 0;
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.footer-links {
  margin-bottom: 2rem;
}

.footer-links a {
  color: var(--white);
  margin: 0 1rem;
  opacity: 0.8;
  transition: var(--transition);
}

.footer-links a:hover {
  opacity: 1;
  color: var(--accent-green);
}

.footer-text {
  font-size: 0.9rem;
  opacity: 0.7;
  line-height: 1.6;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--border-radius);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
  position: relative;
}

.modal-close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--medium-gray);
  transition: var(--transition);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--light-gray);
  color: var(--dark-gray);
}

/* Document Styles (for terms and privacy pages) */
.document-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  background: var(--white);
  min-height: 100vh;
}

.document-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 3px solid var(--primary-green);
}

.document-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  color: var(--primary-green);
  margin-bottom: 1rem;
}

.document-date {
  color: var(--medium-gray);
  font-size: 1rem;
}

.document-content {
  line-height: 1.8;
}

.document-content h2 {
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--light-green);
}

.document-content h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--light-green);
}

.document-content ol, .document-content ul {
  margin-left: 2rem;
  margin-bottom: 1.5rem;
}

.document-content li {
  margin-bottom: 0.5rem;
}

.document-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  box-shadow: var(--shadow);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.document-content th,
.document-content td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
}

.document-content th {
  background: var(--primary-green);
  color: var(--white);
  font-weight: 500;
}

.document-content tr:nth-child(even) {
  background: var(--light-gray);
}

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  padding: 0.5rem 1rem;
  background: var(--light-gray);
  border-radius: var(--border-radius);
  color: var(--primary-green);
  text-decoration: none;
  transition: var(--transition);
}

.back-link:hover {
  background: var(--primary-green);
  color: var(--white);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .section {
    padding: 2rem 0;
  }
  
  .header {
    padding: 2rem 1rem;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  .btn-group {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
    text-align: center;
  }
  
  .faq-question,
  .faq-answer.active {
    padding: 1rem;
  }
  
  .document-container {
    padding: 1rem;
  }
  
  .modal-content {
    padding: 1.5rem;
    margin: 1rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.5rem;
  }
  
  .header {
    padding: 1.5rem 0.5rem;
  }
  
  .card {
    padding: 1rem;
  }
  
  .rules-list li {
    padding-left: 2.5rem;
  }
  
  .rules-list li::before {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.8rem;
  }
}

/* Print Styles */
@media print {
  .header,
  .footer,
  .modal,
  .btn,
  .back-link {
    display: none;
  }
  
  .document-container {
    max-width: none;
    padding: 0;
    box-shadow: none;
  }
  
  .section {
    break-inside: avoid;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
  }
  
  h1, h2, h3 {
    page-break-after: avoid;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.4);
  }
  
  .card,
  .faq-item,
  .modal-content {
    border: 2px solid var(--dark-gray);
  }
  
  .btn {
    border: 2px solid currentColor;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}