/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard

  .navbar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
  }

  .navbar-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
  }
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Basic reset and global styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
}

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

/* ヘッダー・ナビゲーション */
.header {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.navbar-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: #3b82f6;
  text-decoration: none;
}

.navbar-brand:hover {
  color: #2563eb;
}

.navbar-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.navbar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.35rem;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  padding: 0.5rem;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.navbar-toggle:hover,
.navbar-toggle:focus {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.navbar-toggle:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.35);
  outline-offset: 2px;
}

.navbar-toggle-bar {
  display: block;
  width: 1.5rem;
  height: 2px;
  background-color: #1f2937;
  border-radius: 9999px;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
}

.navbar-toggle:hover .navbar-toggle-bar,
.navbar-toggle:focus .navbar-toggle-bar {
  background-color: #111827;
}

.navbar-toggle.is-active .navbar-toggle-bar:nth-child(2) {
  transform: translateY(0.1rem) rotate(-45deg);
}

.navbar-toggle.is-active .navbar-toggle-bar:nth-child(3) {
  opacity: 0;
}

.navbar-toggle.is-active .navbar-toggle-bar:nth-child(4) {
  transform: translateY(-0.1rem) rotate(45deg);
}

.navbar-toggle.is-active {
  gap: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.nav-link {
  color: #6b7280;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

.nav-link:hover {
  color: #374151;
  background-color: #f9fafb;
}

.nav-link-primary {
  background-color: #3b82f6;
  color: white;
}

.nav-link-primary:hover {
  background-color: #2563eb;
  color: white;
}

/* User name in navbar */
.nav-user-name {
  color: #374151;
  font-weight: 600;
  padding: 0.5rem 1rem;
  background-color: #f3f4f6;
  border-radius: 6px;
  margin-right: 0.5rem;
}

.navbar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1000;
}

.navbar-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    position: relative;
  }

  .navbar-header {
    width: 100%;
    justify-content: space-between;
  }

  .navbar-toggle {
    display: inline-flex;
  }

  .navbar-nav {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    width: 50vw;
    min-width: 240px;
    background-color: white;
    padding: 0.75rem;
    border-radius: 0.75rem 0 0 0.75rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 1050;
  }

  .navbar-nav.is-open {
    display: flex;
  }

  .nav-link,
  .nav-user-name {
    width: 100%;
    margin: 0;
    text-align: left;
    padding: 0.75rem 1rem;
  }

  .nav-link {
    border-radius: 6px;
  }

  .nav-user-name {
    background-color: #e5e7eb;
  }
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background-color: #007bff;
  color: white;
}

.btn-primary:hover {
  background-color: #0056b3;
}

.btn-outline {
  background-color: transparent;
  color: #007bff;
  border: 2px solid #007bff;
}

.btn-outline:hover {
  background-color: #007bff;
  color: white;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4rem 0;
  text-align: center;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.hero-description {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  opacity: 0.8;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Features Section */
.features-section {
  padding: 4rem 0;
  background-color: white;
}

.section-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 3rem;
  color: #333;
}

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

.feature-card {
  text-align: center;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  background-color: #f8f9fa;
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #333;
}

.feature-card p {
  color: #666;
  line-height: 1.6;
}

/* Recent Predictions Section */
.recent-predictions-section {
  padding: 4rem 0;
  background-color: #f8f9fa;
}

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

.prediction-card {
  background-color: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.prediction-card h3 {
  margin-bottom: 0.5rem;
}

.prediction-card h3 a {
  color: #007bff;
  text-decoration: none;
}

.prediction-card h3 a:hover {
  text-decoration: underline;
}

.prediction-description {
  color: #666;
  margin-bottom: 1rem;
}

.prediction-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: #999;
}

/* Alerts */
.alert {
  padding: 1rem;
  margin: 1rem auto;
  max-width: 1200px;
  border-radius: 6px;
  font-weight: 500;
}

.alert-success {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Footer */
.footer {
  background-color: #333;
  color: white;
  padding: 1rem 0;
  margin-top: 4rem;
  text-align: center;
}

.footer-content {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-content p {
  margin: 0;
}

.footer-links {
  margin: 0;
}

.footer-link {
  color: #bdc3c7;
  text-decoration: none;
  font-size: 0.9rem;
  margin: 0 1rem;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: white;
  text-decoration: underline;
}

/* 認証フォーム */
.auth-container {
  max-width: 400px;
  margin: 4rem auto;
  padding: 0 1rem;
}

.auth-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

.auth-title {
  font-size: 2rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 2rem;
  color: #1f2937;
}

.auth-form {
  margin-bottom: 2rem;
}

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

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-full {
  width: 100%;
}

.auth-links {
  text-align: center;
  color: #6b7280;
}

.auth-links p {
  margin-bottom: 1rem;
}

/* プロフィールページ */
.profile-container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.profile-header h1 {
  font-size: 2rem;
  font-weight: 600;
  color: #1f2937;
}

.profile-content {
  display: grid;
  gap: 2rem;
}

.profile-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

.profile-card h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1.5rem;
}

.profile-field {
  margin-bottom: 1.5rem;
}

.profile-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

.profile-value {
  font-size: 1rem;
  color: #1f2937;
  padding: 0.5rem 0;
}

/* 予想ページ */
.predictions-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.predictions-header {
  margin-bottom: 2rem;
}

.predictions-header h1 {
  font-size: 2rem;
  font-weight: 600;
  color: #1f2937;
}

.predictions-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  text-align: center;
}

/* メインコンテンツの調整 */
main {
  padding-top: 0;
}

/* ヒーローセクションの調整 */
.hero-section {
  padding-top: 2rem;
}

/* Utility classes */
.text-center {
  text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .navbar .container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .navbar-nav {
    justify-content: center;
  }
  
  .profile-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .auth-container {
    margin: 2rem auto;
  }
  
  .navbar {
    flex-direction: column;
    gap: 1rem;
  }
  
  .navbar-nav {
    gap: 1rem;
  }
}

/* Password Visibility Toggle */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper .form-control,
.password-wrapper .form-input {
  padding-right: 2.5rem; /* Make space for the icon */
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: #374151;
}

.password-toggle:focus {
  outline: none;
  color: #3b82f6;
}


.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: #374151;
}

.text-link {
  color: #3b82f6;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

/* Modal Dialog */
.modal-dialog {
  border: none;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  padding: 0;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  margin: auto;
  position: fixed;
  inset: 0;
}

.modal-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.modal-content-wrapper {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  background: white;
  position: sticky;
  top: 0;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.modal-close-icon {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.modal-close-icon:hover {
  background-color: #f3f4f6;
  color: #374151;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  background: #f9fafb;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  background: white;
  display: flex;
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
}

/* Terms content inside modal */
.modal-body .terms-content h1 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e5e7eb;
}

.modal-body .terms-content h2 {
  font-size: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #374151;
}

.modal-body .terms-content p {
  margin-bottom: 1rem;
  line-height: 1.7;
  color: #4b5563;
}

.modal-body .terms-content ul,
.modal-body .terms-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.modal-body .terms-content li {
  margin-bottom: 0.5rem;
  color: #4b5563;
}
