/* ==========================================
   Custom Styles for Organization Directory
   ========================================== */

/* CSS Custom Properties for Theming */
:root {
  --primary-color: #3b82f6;
  --secondary-color: #8b5cf6;
  --accent-color: #06b6d4;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

/* Dark Mode Variables */
.dark {
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --bg-primary: #1e293b;
  --bg-secondary: #0f172a;
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================
   Hero Banner Styles
   ========================================== */

/* Hero Banner Container */
.hero-banner {
  min-height: 500px;
  position: relative;
}

/* Hero Image Background */
.hero-image {
  z-index: 0;
}

.hero-image img {
  object-fit: cover;
  object-position: center;
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease;
}

/* Hero overlay for text readability */
.hero-overlay {
  z-index: 1;
  transition: background 0.3s ease;
}

/* Darker overlay in dark mode for better contrast */
.dark .hero-overlay {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.7)) !important;
}

/* Animated gradient background (fallback) */
.hero-background {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Animated pattern overlay */
.hero-pattern {
  background-image:
    repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255, 255, 255, .05) 35px, rgba(255, 255, 255, .05) 70px),
    repeating-linear-gradient(-45deg, transparent, transparent 35px, rgba(255, 255, 255, .05) 35px, rgba(255, 255, 255, .05) 70px);
  animation: patternMove 20s linear infinite;
}

@keyframes patternMove {
  0% {
    background-position: 0 0, 0 0;
  }

  100% {
    background-position: 70px 70px, -70px -70px;
  }
}

/* Floating animation for icon */
@keyframes float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-20px);
  }
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* Wave SVG styling */
.wave-svg {
  width: 100%;
  height: 120px;
  display: block;
  position: relative;
  z-index: 2;
}

.wave-path {
  fill: #f8fafc;
  transition: fill 0.3s ease;
}

.dark .wave-path {
  fill: #0f172a;
}

/* Hero content text shadows */
.hero-content {
  position: relative;
  z-index: 10;
}

.hero-content h1 {
  text-shadow: 0 4px 6px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-content p {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3);
}

.hero-content i {
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}

/* Responsive hero adjustments */
@media (max-width: 768px) {
  .hero-banner {
    min-height: 400px;
  }

  .wave-svg {
    height: 60px;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
  border-radius: 6px;
  border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--secondary-color), var(--primary-color));
}

/* Dark mode scrollbar */
.dark ::-webkit-scrollbar-track {
  background: #0f172a;
}

.dark ::-webkit-scrollbar-thumb {
  border-color: #0f172a;
}

/* Animation Keyframes */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

/* Fade-in classes */
.fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

.fade-in-delay {
  animation: fadeIn 0.6s ease-out 0.2s forwards;
  opacity: 0;
}

.fade-in-delay-2 {
  animation: fadeIn 0.6s ease-out 0.4s forwards;
  opacity: 0;
}

/* Service Card Animations */
.service-card,
.game-server-card {
  animation: slideUp 0.5s ease-out forwards;
  opacity: 0;
}

/* Card hover effects */
.service-card,
.game-server-card {
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 1rem;
  pointer-events: none;
}

.service-card:hover::before {
  opacity: 1;
}

/* Gradient color classes for service icons */
.from-blue-500 {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.from-purple-500 {
  background: linear-gradient(135deg, #a855f7, #9333ea);
}

.from-green-500 {
  background: linear-gradient(135deg, #10b981, #059669);
}

.from-orange-500 {
  background: linear-gradient(135deg, #f97316, #ea580c);
}

.from-red-500 {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.from-cyan-500 {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.from-pink-500 {
  background: linear-gradient(135deg, #ec4899, #db2777);
}

.from-indigo-500 {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.from-teal-500 {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
}

.from-amber-500 {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Dark mode specific adjustments */
/* Removed custom dark background - using Tailwind dark:bg-slate-800 instead for proper opacity */

/* Search input glow effect on focus */
input:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.dark input:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Line clamp utility (for description truncation) */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Smooth transitions for theme switching */
* {
  transition-property: background-color, border-color, color;
  transition-duration: 300ms;
  transition-timing-function: ease-in-out;
}

/* Dark mode toggle button pulse effect */
@keyframes buttonPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(59, 130, 246, 0);
  }
}

button:active {
  animation: buttonPulse 0.4s ease-out;
}

/* Gradient text effect */
.gradient-text {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Loading skeleton (for future use) */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.dark .skeleton {
  background: linear-gradient(90deg, #2d3748 25%, #1a202c 50%, #2d3748 75%);
  background-size: 200% 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .service-card {
    animation: fadeIn 0.4s ease-out forwards;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
  }

  .service-card {
    box-shadow: none;
    border: 1px solid #e2e8f0;
    page-break-inside: avoid;
  }

  button[aria-label="Toggle dark mode"],
  input[type="text"] {
    display: none;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .service-card {
    border: 2px solid currentColor;
  }
}