@import "tailwindcss";

/* app/globals.css */

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

/* ─── LBB Admin Palette ───
   Client-supplied brand colors, used across the admin panel (dark UI).
   Primary #CD1407 / Secondary #FFB4A8 / Tertiary #881E13 / Neutral #131313 */
@theme {
  --color-lbb-black:  #131313;
  --color-lbb-dark:   #1a1211;
  --color-lbb-card:   #1f1615;
  --color-lbb-border: #3a2624;
  --color-lbb-purple: #CD1407;
  --color-lbb-purple-dark: #881E13;
  --color-lbb-pink:   #FFB4A8;
  --color-lbb-white:  #ffffff;
  --color-lbb-text:   #f5edeb;
  --color-lbb-muted:  #9c827e;
}

/* ─── Front-end (Public Site) Palette ───
   Material-3-style semantic tokens for the public-facing pages. */
@theme {
  --color-surface:                  #131313;
  --color-surface-container-lowest: #0e0e0e;
  --color-surface-container-low:    #1c1b1b;
  --color-surface-container:        #201f1f;
  --color-surface-container-high:   #2a2a2a;
  --color-surface-container-highest:#353534;
  --color-surface-bright:           #393939;
  --color-primary:                  #ffb4a8;
  --color-primary-container:        #cd1407;
  --color-secondary-container:      #881e13;
  --color-on-surface:               #e5e2e1;
  --color-on-surface-variant:       #e7bdb6;
  --color-on-primary-container:     #ffdfda;
  --color-outline-variant:          #5d3f3a;
}

/* ─── Shadcn-style Design Tokens (Light Mode) ─── */
:root {
  --background: black;
  --foreground: 240 10% 3.9%;

  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;

  --popover: 0 0% 100%;
  --popover-foreground: 240 10% 3.9%;

  /* --primary: 262.1 83.6% 57.8%; */
  --primary-foreground: 210 40% 98%;

  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;

  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;

  --accent: 240 4.8% 95.9%;
  --accent-foreground: 240 5.9% 10%;

  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --ring: 262.1 83.6% 57.8%;

  --radius: 0.75rem;
}

/* ─── Base Styles ─── */
@layer base {
  * {
    box-sizing: border-box;
    border-color: hsl(var(--border));
  }

  html {
    scroll-behavior: smooth;
  }

  body {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  ::selection {
    background-color: hsl(var(--primary));
    color: white;
  }

  /* Scrollbar */
  ::-webkit-scrollbar {
    width: 6px;
  }

  ::-webkit-scrollbar-track {
    background: hsl(var(--background));
  }

  ::-webkit-scrollbar-thumb {
    background: hsl(var(--border));
    border-radius: 3px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--primary));
  }
}

/* ─── Component Utilities ─── */
@layer components {

  /* Dark scrollbar for black/red modals & overlays */
  .dark-scroll {
    scrollbar-color: #CD1407 #130404;
  }

  .dark-scroll::-webkit-scrollbar {
    width: 8px;
  }

  .dark-scroll::-webkit-scrollbar-track {
    background: #130404;
  }

  .dark-scroll::-webkit-scrollbar-thumb {
    background: #CD1407;
    border-radius: 4px;
  }

  .dark-scroll::-webkit-scrollbar-thumb:hover {
    background: #e2231a;
  }

  /* Glass card effect - Premium Light */
  .glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(228, 228, 231, 0.4);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.02);
  }

  /* Gradient text - Refined */
  .gradient-text {
    background: linear-gradient(135deg, hsl(var(--primary)), #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  /* Glow effect - Subtle */
  .purple-glow {
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.1);
  }

  /* Confession card - Modern Minimal */
  .confession-card {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    border-radius: var(--radius);
  }

  .confession-card:hover {
    border-color: hsl(var(--primary));
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(168, 85, 247, 0.08);
  }

  /* Input styles - dark admin theme */
  .lbb-input {
    background: var(--color-lbb-card);
    border: 1px solid var(--color-lbb-border);
    color: var(--color-lbb-text);
    border-radius: calc(var(--radius) - 2px);
    padding: 12px 16px;
    width: 100%;
    transition: all 0.2s ease;
    font-size: 15px;
  }

  .lbb-input:focus {
    outline: none;
    border-color: var(--color-lbb-purple);
    box-shadow: 0 0 0 2px rgba(205, 20, 7, 0.15);
  }

  .lbb-input::placeholder {
    color: var(--color-lbb-muted);
  }

  /* Primary button - Premium Solid */
  .btn-primary {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    padding: 12px 24px;
    border-radius: calc(var(--radius) - 2px);
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.25);
  }

  .btn-primary:active {
    transform: translateY(0);
  }

  .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
  }

  /* Secondary button - Minimalist */
  .btn-secondary {
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    padding: 12px 24px;
    border-radius: calc(var(--radius) - 2px);
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s ease;
    border: 1px solid hsl(var(--border));
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

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

  /* Status badges - visible on dark admin cards */
  .badge-pending {
    background: rgba(234, 179, 8, 0.12);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.25);
    border-radius: 9999px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 500;
  }

  .badge-approved {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 9999px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 500;
  }

  .badge-rejected {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 9999px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 500;
  }

  .badge-archived {
    background: rgba(156, 130, 126, 0.12);
    color: var(--color-lbb-muted);
    border: 1px solid rgba(156, 130, 126, 0.25);
    border-radius: 9999px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 500;
  }

  /* Material Symbols variable font attributes & Fluent Form overrides */
  .material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  }

  .fill-icon {
    font-variation-settings: 'FILL' 1;
  }

  /* AMA Card base */
  .ama-card {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 230px;
    padding: 1.75rem 3rem;
    border-radius: 1.5rem;
    background: #171717;
    border: 1px solid transparent;
    transition: background 0.3s ease, border-color 0.3s ease;
  }

  @media (max-width: 640px) {
    .ama-card {
      min-height: 340px;
      padding: 1.5rem 2.25rem;
    }
  }

  .ama-card:hover {
    background: linear-gradient(to bottom, #2a0a0d, #1a0507);
    border-color: rgba(205, 20, 7, .35);
  }

  .cat-title {
    display: inline-block;
    width: auto;
    text-align: center;
    font-weight: 900;
    font-style: italic;
    letter-spacing: -0.01em;
    font-size: 1.75rem;
    color: #f6ece9;
    text-shadow: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
  }

  @media (min-width: 768px) {
    .cat-title {
      font-size: 2.5rem;
    }
  }

  .ama-card:hover .cat-title {
    color: #ffb4a8;
    text-shadow: 0 0 20px rgba(205, 20, 7, .4);
  }

  .ama-card .bubble {
    position: absolute;
    width: max-content;
    max-width: 220px;
    background: linear-gradient(135deg, #fbf7ee 0%, #f0e9d8 100%);
    color: #1a1a1a;
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    padding: 12px 16px;
    border-radius: 22px;
    white-space: normal;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transform: scale(0.85) translateY(8px) rotate(var(--rot, 0deg));
    transition: all .5s cubic-bezier(.2, .8, .2, 1);
    z-index: 3;
  }

  .ama-card .bubble:hover {
    background: linear-gradient(135deg, #ffc9bd 0%, #ffb4a8 100%) !important;
    color: #1a1a1a;
    transform: scale(1.06) translateY(-2px) rotate(0deg) !important;
    cursor: pointer;
    box-shadow: 0 18px 44px rgba(205, 20, 7, .35), 0 0 0 1px rgba(205, 20, 7, .35), inset 0 1px 0 rgba(255, 255, 255, .6) !important;
  }

  @media (max-width: 640px) {
    .ama-card .bubble {
      max-width: 140px;
      font-size: 11px;
      line-height: 1.35;
      padding: 9px 11px;
      border-radius: 16px;
    }
  }

  .ama-card .bubble::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: inherit;
  }

  /* AMA Card Open & Hover states */
  .ama-card::after {
    content: '+';
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    font-family: 'Manrope', sans-serif;
    font-weight: 300;
    font-size: 26px;
    line-height: 1;
    color: #CD1407;
    transition: transform .35s ease;
    z-index: 8;
  }

  .ama-card.is-open::after {
    transform: rotate(45deg);
  }

  .ama-card .bubble.b1 {
    top: 14px;
    left: 16px;
    transform-origin: top left;
    --rot: -2deg;
  }

  .ama-card .bubble.b1::after {
    bottom: -5px;
    left: 20px;
    transform: rotate(45deg);
  }

  .ama-card .bubble.b2 {
    top: 14px;
    right: 16px;
    transform-origin: top right;
    --rot: 2deg;
  }

  .ama-card .bubble.b2::after {
    bottom: -5px;
    right: 20px;
    transform: rotate(45deg);
  }

  .ama-card .bubble.b3 {
    bottom: 14px;
    left: 16px;
    transform-origin: bottom left;
    --rot: 2deg;
  }

  .ama-card .bubble.b3::after {
    top: -5px;
    left: 20px;
    transform: rotate(45deg);
  }

  .ama-card .bubble.b4 {
    bottom: 14px;
    right: 16px;
    transform-origin: bottom right;
    --rot: -2deg;
  }

  .ama-card .bubble.b4::after {
    top: -5px;
    right: 20px;
    transform: rotate(45deg);
  }

  .ama-card:hover .bubble {
    opacity: 1;
    transform: scale(1) translateY(0) rotate(var(--rot, 0deg));
    pointer-events: auto;
  }

  @media (max-width: 820px) {
    .ama-card.is-open .bubble {
      opacity: 1 !important;
      transform: scale(1) translateY(0) rotate(var(--rot, 0deg)) !important;
      pointer-events: auto;
    }
  }

  @media (min-width: 821px) {
    .ama-card.is-open .bubble {
      display: none;
    }
  }

  .ama-card.is-submitted .bubble {
    display: none !important;
  }
}

/* ─── Animations ─── */
@layer utilities {
  .animate-fade-in {
    animation: fadeIn 0.4s ease-out;
  }

  .animate-slide-up {
    animation: slideUp 0.4s ease-out;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeRise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}