/* ========================================
   柏ポーカーサークル - Custom CSS
   ======================================== */

/* ========== Poker Chips Pattern ========== */
.poker-chips-pattern {
  background-image:
    radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 60%, rgba(124, 58, 237, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(167, 139, 250, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 70% 20%, rgba(59, 130, 246, 0.2) 0%, transparent 50%);
  background-size: 600px 600px, 400px 400px, 500px 500px, 450px 450px;
  background-position: 0 0, 100% 100%, 50% 50%, 80% 20%;
  animation: floatChips 20s ease-in-out infinite;
}

@keyframes floatChips {
  0%, 100% {
    background-position: 0 0, 100% 100%, 50% 50%, 80% 20%;
  }
  50% {
    background-position: 100px 100px, calc(100% - 100px) calc(100% - 100px), calc(50% + 50px) calc(50% - 50px), calc(80% - 50px) calc(20% + 50px);
  }
}

/* ========== Cards Pattern ========== */
.cards-pattern {
  background-image:
    linear-gradient(45deg, rgba(59, 130, 246, 0.05) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(124, 58, 237, 0.05) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(59, 130, 246, 0.05) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(124, 58, 237, 0.05) 75%);
  background-size: 60px 60px;
  background-position: 0 0, 0 30px, 30px -30px, -30px 0px;
}

/* ========== Smooth Scrolling (for browsers that don't support CSS scroll-behavior) ========== */
html {
  scroll-behavior: smooth;
}

/* ========== Custom Scrollbar ========== */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #3b82f6, #7c3aed);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #2563eb, #6d28d9);
}

/* ========== Selection Color ========== */
::selection {
  background-color: rgba(124, 58, 237, 0.3);
  color: #1e3a8a;
}

::-moz-selection {
  background-color: rgba(124, 58, 237, 0.3);
  color: #1e3a8a;
}

/* ========== Focus Visible Styles ========== */
*:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
}

/* ========== Utility: Gradient Text ========== */
.gradient-text {
  background: linear-gradient(to right, #3b82f6, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========== Smooth Hover Transitions for Links ========== */
a {
  transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
}

/* ========== Card Suit Symbols Enhancement ========== */
.poker-suit {
  display: inline-block;
  font-size: 3rem;
  line-height: 1;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.poker-suit.spade {
  color: #1e3a8a;
}

.poker-suit.heart {
  color: #dc2626;
}

.poker-suit.diamond {
  color: #dc2626;
}

.poker-suit.club {
  color: #1e3a8a;
}

/* ========== Form Input Focus Glow ========== */
input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ========== Button Ripple Effect Base ========== */
button {
  position: relative;
  overflow: hidden;
}

/* ========== Responsive Video Container ========== */
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ========== Hero Section Text Shadow for Readability ========== */
#hero h1,
#hero p {
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

/* ========== Mobile Menu Transition ========== */
#mobile-menu {
  transition: all 0.3s ease-in-out;
}

/* ========== Prevent Horizontal Scroll ========== */
body {
  overflow-x: hidden;
}

/* ========== Print Styles ========== */
@media print {
  nav,
  #mobile-menu-button,
  footer {
    display: none;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  h1, h2, h3 {
    page-break-after: avoid;
  }

  img {
    max-width: 100% !important;
  }
}

/* ========== Accessibility: Reduced Motion ========== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .poker-chips-pattern {
    animation: none;
  }
}

/* ========== High Contrast Mode Support ========== */
@media (prefers-contrast: high) {
  .poker-chips-pattern,
  .cards-pattern {
    opacity: 0;
  }

  button,
  a {
    text-decoration: underline;
  }
}

/* ========== Dark Mode Support (Future Enhancement) ========== */
@media (prefers-color-scheme: dark) {
  /*
    Note: This site uses a dark hero section and specific branding colors,
    so we're keeping the existing color scheme regardless of system preference.
    If needed in the future, dark mode styles can be added here.
  */
}

/* ========== Loading State (for future use) ========== */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #3b82f6;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========== Custom Tooltip (for future use) ========== */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 8px 12px;
  background: rgba(30, 58, 138, 0.95);
  color: white;
  font-size: 0.875rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
  z-index: 1000;
}

[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* ========== Ensure images don't overflow ========== */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ========== Prevent layout shift from lazy-loaded images ========== */
img[loading="lazy"] {
  min-height: 100px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
