@tailwind base;
@tailwind components;
@tailwind utilities;

/* ========================================
   FANSITESHUB - EDITORIAL MAGAZINE THEME
   Warm, sophisticated, modern design
   ======================================== */

/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700;800&display=swap');

@layer utilities {
  .floating-animation {
    animation: float 6s ease-in-out infinite;
  }
  .pulse-glow {
    animation: warmGlow 3s infinite;
  }
}

/* ========================================
   KEYFRAME ANIMATIONS
   ======================================== */

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

@keyframes warmGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(249, 115, 22, 0.2), 0 0 40px rgba(249, 115, 22, 0.1); }
  50% { box-shadow: 0 0 30px rgba(249, 115, 22, 0.35), 0 0 50px rgba(249, 115, 22, 0.2); }
}

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

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes gentlePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes borderGlow {
  0%, 100% { border-color: rgba(249, 115, 22, 0.3); }
  50% { border-color: rgba(249, 115, 22, 0.6); }
}

/* ========================================
   BASE STYLES & TYPOGRAPHY
   ======================================== */

html {
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Display headings use Playfair Display */
.font-display {
  font-family: 'Playfair Display', Georgia, serif;
}

/* ========================================
   LIGHT THEME (Default)
   ======================================== */

html:not(.dark) body {
  background-color: #fefdfb !important;
  color: #1a1614 !important;
}

/* ========================================
   DARK THEME
   ======================================== */

html.dark body {
  background-color: #0f0d0c !important;
  color: #f8f6f4 !important;
}

/* ========================================
   HEADINGS
   ======================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  color: #1a1614 !important;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dark h1, .dark h2, .dark h3, .dark h4, .dark h5, .dark h6 {
  color: #fefdfb !important;
}

/* ========================================
   GRADIENT TEXT
   ======================================== */

.gradient-text {
  background-image: linear-gradient(135deg, #f97316 0%, #ea580c 40%, #14b8a6 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: text-gradient-flow 8s ease-in-out infinite;
}

@keyframes text-gradient-flow {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 200% center; }
}

/* ========================================
   CARD STYLES
   ======================================== */

/* Light theme cards */
.glass-card {
  background: rgba(254, 253, 251, 0.95);
  border: 1px solid rgba(212, 184, 150, 0.3);
  box-shadow: 
    0 4px 6px -1px rgba(26, 22, 20, 0.04),
    0 2px 4px -2px rgba(26, 22, 20, 0.06),
    0 0 0 1px rgba(212, 184, 150, 0.1);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark theme cards */
.dark .glass-card {
  background: rgba(26, 22, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(99, 84, 75, 0.3);
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.2),
    0 2px 4px -2px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* Card hover effects */
.card-hover {
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 20px 25px -5px rgba(26, 22, 20, 0.08),
    0 8px 10px -6px rgba(26, 22, 20, 0.04),
    0 0 0 1px rgba(249, 115, 22, 0.15);
  border-color: rgba(249, 115, 22, 0.25);
}

.dark .card-hover:hover {
  box-shadow: 
    0 20px 25px -5px rgba(0, 0, 0, 0.3),
    0 8px 10px -6px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(249, 115, 22, 0.2);
  border-color: rgba(249, 115, 22, 0.3);
}

/* ========================================
   FEATURED / PROMO CARDS
   ======================================== */

.promo-card {
  background: linear-gradient(145deg, #0f766e 0%, #115e59 50%, #134e4a 100%) !important;
  color: white !important;
  position: relative;
  overflow: hidden;
}

.promo-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
  pointer-events: none;
}

.promo-card h3, .promo-card h4 {
  color: white !important;
}

.promo-card p {
  color: rgba(204, 251, 241, 0.9) !important;
}

/* Legacy support for ai-create-card */
.ai-create-card {
  background: linear-gradient(145deg, #0f766e 0%, #115e59 50%, #134e4a 100%) !important;
  color: white !important;
}

.ai-create-card h3 {
  color: white !important;
}

.ai-create-card p {
  color: rgba(204, 251, 241, 0.9) !important;
}

/* ========================================
   NAVIGATION
   ======================================== */

.nav-link {
  position: relative;
  color: #63544b;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #f97316, #14b8a6);
  transition: width 0.3s ease;
  border-radius: 1px;
}

.nav-link:hover {
  color: #f97316;
}

.nav-link:hover::after {
  width: 100%;
}

.dark .nav-link {
  color: #bfb2a1;
}

.dark .nav-link:hover {
  color: #fb923c;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn-primary {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  box-shadow: 0 4px 14px -2px rgba(249, 115, 22, 0.35);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px -2px rgba(249, 115, 22, 0.45);
}

.btn-secondary {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  color: white;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  box-shadow: 0 4px 14px -2px rgba(20, 184, 166, 0.35);
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px -2px rgba(20, 184, 166, 0.45);
}

/* ========================================
   TAGS & BADGES
   ======================================== */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  transition: all 0.2s ease;
}

.badge-text {
  color: #63544b !important;
}

.dark .badge-text {
  color: #d8cfc4 !important;
}

/* ========================================
   DATE PICKER / NAVIGATION PILLS
   ======================================== */

.date-pill {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.1) 0%, rgba(20, 184, 166, 0.1) 100%);
  border: 1px solid rgba(249, 115, 22, 0.2);
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-weight: 600;
  color: #1a1614;
}

.dark .date-pill {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.15) 0%, rgba(20, 184, 166, 0.15) 100%);
  border-color: rgba(249, 115, 22, 0.3);
  color: #fefdfb;
}

/* ========================================
   SCROLLBAR
   ======================================== */

::-webkit-scrollbar {
  width: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #d4b896, #bfb2a1);
  border-radius: 5px;
  border: 2px solid #faf3e8;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #a69483, #8d7a69);
}

.dark ::-webkit-scrollbar-track {
  background: #1a1614;
}

.dark ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #534742, #473e3a);
  border-color: #1a1614;
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #63544b, #534742);
}

/* ========================================
   ANIMATIONS
   ======================================== */



/* ========================================
   FEATURED ARTICLE STYLING
   ======================================== */

.featured-article {
  position: relative;
  border: 2px solid transparent;
  background-image: linear-gradient(#fefdfb, #fefdfb), 
                    linear-gradient(135deg, #f97316 0%, #14b8a6 100%);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

.dark .featured-article {
  background-image: linear-gradient(#1a1614, #1a1614), 
                    linear-gradient(135deg, #f97316 0%, #14b8a6 100%);
}

.featured-article::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, #f97316 0%, #14b8a6 100%);
  z-index: -1;
  opacity: 0.15;
  filter: blur(20px);
  animation: gentlePulse 3s ease-in-out infinite;
}

/* ========================================
   TYPOGRAPHY - PROSE
   ======================================== */

.prose {
  line-height: 1.8;
  color: #534742;
}

.dark .prose {
  color: #d8cfc4;
}

.prose p {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
}

.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  font-family: 'Playfair Display', Georgia, serif;
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  line-height: 1.25;
  font-weight: 700;
  color: #1a1614;
}

.dark .prose h1, .dark .prose h2, .dark .prose h3, 
.dark .prose h4, .dark .prose h5, .dark .prose h6 {
  color: #fefdfb;
}

.prose h1 { font-size: 2.25em; }
.prose h2 { font-size: 1.75em; }
.prose h3 { font-size: 1.5em; }

.prose a {
  color: #ea580c;
  text-decoration: underline;
  text-decoration-color: rgba(234, 88, 12, 0.3);
  text-underline-offset: 3px;
  transition: all 0.2s ease;
}

.prose a:hover {
  color: #f97316;
  text-decoration-color: #f97316;
}

.dark .prose a {
  color: #fb923c;
  text-decoration-color: rgba(251, 146, 60, 0.3);
}

.dark .prose a:hover {
  color: #fdba74;
  text-decoration-color: #fdba74;
}

.prose strong {
  font-weight: 600;
  color: #1a1614;
}

.dark .prose strong {
  color: #fefdfb;
}

.prose ul, .prose ol {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
  padding-left: 1.75em;
}

.prose ul { list-style-type: disc; }
.prose ol { list-style-type: decimal; }

.prose li > ul, .prose li > ol {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

.prose blockquote {
  margin-top: 1.5em;
  margin-bottom: 1.5em;
  padding: 1em 1.5em;
  border-left: 4px solid #f97316;
  background: rgba(249, 115, 22, 0.05);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #63544b;
}

.dark .prose blockquote {
  background: rgba(249, 115, 22, 0.1);
  color: #bfb2a1;
}

.prose code {
  background-color: rgba(249, 115, 22, 0.1);
  color: #c2410c;
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

.dark .prose code {
  background-color: rgba(249, 115, 22, 0.15);
  color: #fb923c;
}

.prose pre {
  background-color: #1a1614;
  color: #f8f6f4;
  padding: 1.25rem;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 0.9em;
  border: 1px solid rgba(99, 84, 75, 0.3);
}

.prose pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
}

/* ========================================
   STAT HIGHLIGHTS
   ======================================== */

.stat-highlight {
  color: #ea580c;
  font-weight: 600;
  background-color: rgba(249, 115, 22, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.date-highlight {
  color: #0d9488;
  font-weight: 500;
  background-color: rgba(20, 184, 166, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.age-highlight {
  color: #f97316;
  font-weight: 500;
}

/* ========================================
   DECORATIVE ELEMENTS
   ======================================== */

.editorial-line {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #f97316, #14b8a6);
  border-radius: 2px;
}

.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 184, 150, 0.5), transparent);
}

.dark .section-divider {
  background: linear-gradient(90deg, transparent, rgba(99, 84, 75, 0.5), transparent);
}

/* Decorative corner accents */
.corner-accent {
  position: relative;
}

.corner-accent::before,
.corner-accent::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid #f97316;
  opacity: 0.3;
}

.corner-accent::before {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}

.corner-accent::after {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
}

/* ========================================
   TOOLTIP STYLES
   ======================================== */

.tooltip-container {
  position: relative;
}

.tooltip-container [data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 1000;
  background: #1a1614;
  color: #fefdfb;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  max-width: 300px;
  white-space: normal;
  word-wrap: break-word;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

.tooltip-container [data-tooltip]:hover::before {
  content: '';
  position: absolute;
  z-index: 1000;
  border: 6px solid transparent;
  border-top-color: #1a1614;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: -4px;
}

.dark .tooltip-container [data-tooltip]:hover::after {
  background: #fefdfb;
  color: #1a1614;
}

.dark .tooltip-container [data-tooltip]:hover::before {
  border-top-color: #fefdfb;
}

/* ========================================
   IMAGE STYLES
   ======================================== */

.article-image {
  border-radius: 16px;
  transition: all 0.4s ease;
}

.article-image:hover {
  transform: scale(1.02);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.avatar-ring {
  padding: 2px;
  background: linear-gradient(135deg, #f97316, #14b8a6);
  border-radius: 9999px;
}

.avatar-ring img {
  border: 2px solid #fefdfb;
}

.dark .avatar-ring img {
  border-color: #1a1614;
}