/**
 * HymnRO Control Panel - Celestial Theme
 * Complete styling system with hymnro-celestial-flux design
 */

/* CSS Variables for Theme System */
:root {
  /* HymnRO Celestial Color Palette (Night) */
  --hymn-gold: 45 93% 58%;
  --hymn-cyan: 195 100% 50%;
  --hymn-silver: 210 20% 80%;
  --hymn-navy: 230 35% 7%;
  --hymn-dark-blue: 230 45% 15%;
  --hymn-medium-blue: 195 30% 20%;

  /* Semantic Colors */
  --background: var(--hymn-navy);
  --foreground: var(--hymn-silver);
  --card: 230 45% 15% / 0.8;
  --card-foreground: var(--hymn-silver);
  --border: 210 20% 30%;
  --input: 230 45% 15%;
  --primary: var(--hymn-gold);
  --primary-foreground: 230 35% 7%;
  --secondary: var(--hymn-cyan);
  --secondary-foreground: 230 35% 7%;
  --accent: var(--hymn-cyan);
  --accent-foreground: 230 35% 7%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 98%;
  --muted: 210 20% 25%;
  --muted-foreground: 210 20% 60%;
  --success: 142 76% 36%;
  --warning: 38 92% 50%;
  --info: 217 91% 60%;

  /* Gradients */
  --gradient-hero: linear-gradient(135deg, hsl(var(--hymn-navy)), hsl(var(--hymn-dark-blue)), hsl(var(--hymn-medium-blue)));
  --gradient-card: linear-gradient(135deg, hsl(var(--card)), hsl(var(--hymn-dark-blue) / 0.6));
  --gradient-gold: linear-gradient(135deg, hsl(var(--hymn-gold)), hsl(var(--hymn-gold) / 0.8));
  --gradient-cyan: linear-gradient(135deg, hsl(var(--hymn-cyan)), hsl(var(--hymn-cyan) / 0.8));

  /* Shadows */
  --shadow-glow: 0 0 20px hsl(var(--hymn-gold) / 0.3);
  --shadow-card: 0 8px 32px hsl(0 0% 0% / 0.3);
  --shadow-button: 0 4px 16px hsl(var(--primary) / 0.3);
}

/* Light (Day) Theme Overrides - Celestial Flux (Pink) */
[data-theme="light"] {
  /* Base surfaces */
  --hymn-silver: 330 15% 20%;
  --hymn-navy: 340 100% 97%;   /* soft rose background */
  --hymn-dark-blue: 340 100% 94%;
  --hymn-medium-blue: 12 100% 92%; /* peach tint */
  --background: var(--hymn-navy);
  --foreground: 330 20% 20%;
  --card: 0 0% 100% / 0.8;
  --card-foreground: 330 20% 20%;
  --border: 330 20% 85%;
  --input: 0 0% 100%;

  /* Brand accents for day */
  --hymn-pink: 338 88% 70%;     /* primary pink */
  --hymn-rose: 350 80% 68%;     /* deeper rose */
  --hymn-peach: 20 95% 78%;     /* peach highlight */

  --primary: var(--hymn-pink);
  --primary-foreground: 0 0% 100%;
  --secondary: var(--hymn-peach);
  --secondary-foreground: 330 20% 20%;
  --accent: var(--hymn-rose);
  --accent-foreground: 0 0% 100%;

  --muted: 330 20% 88%;
  --muted-foreground: 330 20% 40%;

  /* Light theme gradients */
  --gradient-hero: linear-gradient(135deg, hsl(var(--hymn-navy)), hsl(var(--hymn-peach)), hsl(var(--hymn-rose)));
  --gradient-card: linear-gradient(135deg, hsl(var(--card)), hsl(var(--hymn-peach) / 0.1));
  --gradient-gold: linear-gradient(135deg, hsl(var(--hymn-pink)), hsl(var(--hymn-rose)));
  --gradient-cyan: linear-gradient(135deg, hsl(var(--hymn-peach)), hsl(var(--hymn-rose)));
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gradient-hero);
  color: hsl(var(--foreground));
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.8s ease, color 0.8s ease;
  background-attachment: fixed;
}

/* Smooth theme transitions */
.theme-transition * {
  transition: background-color 0.8s ease, color 0.8s ease, border-color 0.8s ease, box-shadow 0.8s ease;
}

/* Glass morphism effects */
.glass {
  background: hsl(var(--card));
  backdrop-filter: blur(20px);
  border: 1px solid hsl(var(--border));
  box-shadow: var(--shadow-card);
}

/* Container and Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Cards */
.card {
  background: var(--gradient-card);
  backdrop-filter: blur(20px);
  border: 1px solid hsl(var(--border));
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px hsl(var(--foreground) / 0.1);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-primary {
  background: var(--gradient-gold);
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
  box-shadow: var(--shadow-button);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px hsl(var(--primary) / 0.4);
}

.btn-secondary {
  background: var(--gradient-cyan);
  color: hsl(var(--secondary-foreground));
  border-color: hsl(var(--secondary));
}

.btn-outline {
  background: transparent;
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}

.btn-outline:hover {
  background: hsl(var(--muted));
  border-color: hsl(var(--primary));
}

/* Hero Section */
.hero-bg {
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
}

.hero-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 20%, hsl(var(--hymn-gold) / 0.1) 0%, transparent 50%),
              radial-gradient(circle at 70% 80%, hsl(var(--hymn-cyan) / 0.1) 0%, transparent 50%);
  pointer-events: none;
}

/* Navigation */
.nav-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  color: hsl(var(--foreground));
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.nav-item:hover {
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.1);
  border-color: hsl(var(--primary) / 0.3);
}

.nav-item.active {
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.15);
  border-color: hsl(var(--primary) / 0.4);
}

/* Forms */
.form-input, .form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: hsl(var(--input));
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  color: hsl(var(--foreground));
  transition: all 0.3s ease;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1);
}

/* Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }

.mx-auto { margin-left: auto; margin-right: auto; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-x-6 > * + * { margin-left: 1.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

.w-full { width: 100%; }
.w-8 { width: 2rem; }
.w-24 { width: 6rem; }
.h-8 { height: 2rem; }
.h-24 { height: 6rem; }

.max-w-4xl { max-width: 56rem; }

.rounded-full { border-radius: 9999px; }
.rounded-lg { border-radius: 0.5rem; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }

.bg-gradient-to-br { background-image: linear-gradient(to bottom right, var(--tw-gradient-stops)); }
.from-yellow-400 { --tw-gradient-from: #fbbf24; }
.to-cyan-400 { --tw-gradient-to: #22d3ee; }

.text-black { color: #000; }
.text-white { color: #fff; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-yellow-400 { color: #fbbf24; }
.text-cyan-400 { color: #22d3ee; }
.text-green-400 { color: #4ade80; }
.text-red-400 { color: #f87171; }

.bg-gray-700 { background-color: #374151; }
.bg-gray-800 { background-color: #1f2937; }
.bg-green-500 { background-color: #10b981; }
.bg-red-500 { background-color: #ef4444; }

.bg-opacity-20 { background-opacity: 0.2; }

.border { border-width: 1px; }
.border-gray-600 { border-color: #4b5563; }
.border-green-500 { border-color: #10b981; }
.border-red-500 { border-color: #ef4444; }
.border-yellow-400 { border-color: #fbbf24; }

.focus\:border-yellow-400:focus { border-color: #fbbf24; }
.focus\:ring-1:focus { box-shadow: 0 0 0 1px var(--tw-ring-color); }
.focus\:ring-yellow-400:focus { --tw-ring-color: #fbbf24; }

.block { display: block; }
.hidden { display: none; }

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:flex { display: flex; }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:col-span-2 { grid-column: span 2 / span 2; }
}

/* Admin Navigation Button Enhancement */
.admin-nav-btn {
  position: relative;
  overflow: hidden;
}

.admin-nav-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, hsl(var(--hymn-gold) / 0.3), transparent);
  transition: left 0.5s ease;
}

.admin-nav-btn:hover::before {
  left: 100%;
}

.admin-nav-btn:hover {
  box-shadow: 0 0 15px hsl(var(--hymn-gold) / 0.4);
  border-color: hsl(var(--hymn-gold) / 0.6);
}

/* Icon Chip Base Styles */
.icon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.icon-chip:hover {
  transform: translateY(-2px);
  background: hsl(var(--muted));
  border-color: hsl(var(--primary) / 0.5);
  box-shadow: 0 4px 12px hsl(var(--foreground) / 0.1);
}

/* Enhanced Button Styles */
.btn-celestial {
  background: var(--gradient-cyan);
  color: hsl(var(--secondary-foreground));
  border: 1px solid hsl(var(--secondary));
  position: relative;
  overflow: hidden;
}

.btn-celestial::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, hsl(var(--hymn-cyan) / 0.3), transparent);
  transition: left 0.5s ease;
}

.btn-celestial:hover::before {
  left: 100%;
}

.btn-hero {
  background: var(--gradient-gold);
  color: hsl(var(--primary-foreground));
  border: 1px solid hsl(var(--primary));
  position: relative;
  overflow: hidden;
}

.btn-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, hsl(var(--hymn-gold) / 0.3), transparent);
  transition: left 0.5s ease;
}

.btn-hero:hover::before {
  left: 100%;
}

/* Floating Animation for Celestial Elements */
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-10px) rotate(1deg); }
  66% { transform: translateY(-5px) rotate(-1deg); }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

/* Celestial Glow Effects */
.celestial-glow {
  position: relative;
}

.celestial-glow::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: conic-gradient(from 0deg,
    hsl(var(--hymn-gold)),
    hsl(var(--hymn-cyan)),
    hsl(var(--hymn-gold))
  );
  border-radius: inherit;
  opacity: 0;
  z-index: -1;
  animation: rotate 3s linear infinite;
  transition: opacity 0.3s ease;
}

.celestial-glow:hover::after {
  opacity: 0.3;
}
