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

/* Venue tags: preserve original casing (prevents USeB → USEB) */
.venue-tag {
  text-transform: none !important;
  letter-spacing: 0.04em;
}

/* Header logo: single img, CSS handles theme color */
.logo-img {
  /* Light mode: wine/burgundy (#6f333b) */
  filter: invert(17%) sepia(55%) saturate(600%) hue-rotate(315deg) brightness(58%) contrast(120%);
  transition: filter 0.4s ease;
}
.dark .logo-img {
  /* Dark mode: pure white */
  filter: brightness(0) invert(1);
}

/* =============================================
   DARK MODE AGENDA: Card-style layout
   ============================================= */

/* Make the day panel transparent in dark mode */
.dark .agenda-tab-pane > div {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  gap: 10px;
}

/* Base card style — liquid glass */
.dark .agenda-row {
  background: rgba(10, 22, 48, 0.28) !important;   /* very transparent */
  border: none !important;
  border-left: 3px solid #54d8e8 !important;         /* default: cyan */
  border-top: 1px solid rgba(255,255,255,0.06) !important;    /* glass sheen top */
  border-right: 1px solid rgba(255,255,255,0.03) !important;
  border-bottom: none !important;
  border-radius: 14px !important;
  padding: 14px 16px !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 
    inset 0 1px 0 rgba(255,255,255,0.07),
    0 4px 24px rgba(0, 0, 0, 0.3);
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  position: relative;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.dark .agenda-row:hover {
  background: rgba(20, 40, 80, 0.45) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 6px 32px rgba(0, 0, 0, 0.4);
}

/* ── Hotel / Flat Itaipava cards: CYAN ── */
.dark .agenda-row:has(.venue-hotel) {
  border-left-color: #54d8e8 !important;
}
.dark .agenda-row:has(.venue-hotel):hover {
  border-left-color: #91f1ff !important;
}

/* ── USeB venue cards (Auditório, Restaurante, Sede): ORANGE ── */
.dark .agenda-row:has(.venue-useb) {
  border-left-color: #f97316 !important;
}
.dark .agenda-row:has(.venue-useb):hover {
  border-left-color: #fb923c !important;
}

/* Time block: dot indicator that matches card accent color */
.dark .agenda-row > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto !important;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
}

/* Default dot: cyan */
.dark .agenda-row > div:first-child::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #54d8e8;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(84, 216, 232, 0.6);
}

/* Hotel card: cyan dot + cyan time text */
.dark .agenda-row:has(.venue-hotel) > div:first-child::before {
  background: #54d8e8;
  box-shadow: 0 0 6px rgba(84, 216, 232, 0.7);
}
.dark .agenda-row:has(.venue-hotel) > div:first-child {
  color: #54d8e8;
}

/* USeB card: orange dot + orange time text */
.dark .agenda-row:has(.venue-useb) > div:first-child::before {
  background: #f97316;
  box-shadow: 0 0 6px rgba(249, 115, 22, 0.7);
}
.dark .agenda-row:has(.venue-useb) > div:first-child {
  color: #f97316;
}

/* Venue tags: fully rounded in dark mode */
.dark .venue-tag {
  border-radius: 999px !important;
  padding-left: 10px !important;
  padding-right: 10px !important;
}

/* Content block */
.dark .agenda-row > div.flex-grow {
  padding-left: 0;
}

/* Title */
.dark .agenda-row h3 {
  font-size: 1rem !important;
  margin-bottom: 4px !important;
}

/* Bottom nav: active indicator fills full button width as a pill */
.nav-btn .icon-bg {
  width: 100% !important;
  height: 48px !important;
  border-radius: 16px !important;
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

@layer utilities {
  .mesh-bg {
    background-color: #00132e;
    background-image: radial-gradient(at 0% 0%, hsla(215, 60%, 15%, 1) 0, transparent 50%), 
                      radial-gradient(at 100% 0%, hsla(185, 80%, 10%, 1) 0, transparent 50%);
  }

  .glass-card {
    background: rgba(35, 53, 81, 0.6);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: inset 0 0 0 1px rgba(84, 216, 232, 0.15);
  }
  
  .scrollbar-hide::-webkit-scrollbar {
    display: none;
  }
  .scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .radial-glow {
    background: radial-gradient(circle at center, rgba(84, 216, 232, 0.12) 0%, transparent 70%);
  }

  .paper-effect {
    background-color: #f5f0e8;
    background-image: 
        radial-gradient(#d1ccc4 0.5px, transparent 0.5px), 
        radial-gradient(#d1ccc4 0.5px, #f5f0e8 0.5px);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    position: relative;
  }

  .dark .paper-effect {
    background-image: none;
    background-color: transparent;
  }

  .paper-effect::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    z-index: -1;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  }

  .ruled-line {
    border-bottom: 1px solid rgba(133, 115, 116, 0.3);
  }

  .stamp-border {
    border: 2px double #6F333B;
  }

  .rotate-stamp {
    transform: rotate(-2deg);
  }

  .stamped-timer {
    border: 1px solid rgba(111, 51, 59, 0.3);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.02);
  }
}

body {
  min-height: max(884px, 100dvh);
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Base resets via CSS vars switching handled via body class 'light' or 'dark' */
body.light {
    --bg-main: #f5f0e8;
    --text-main: #1d1c17;
}

body.dark {
    --bg-main: #00132e;
    --text-main: #d6e3ff;
}

/* CPU Architecture Animations */
.cpu-architecture {
  offset-anchor: 10px 0px;
  animation: animation-path;
  animation-iteration-count: infinite;
  animation-timing-function: cubic-bezier(0.75, -0.01, 0, 0.99);
}

.cpu-line-1 {
  offset-path: path("M 10 20 h 79.5 q 5 0 5 5 v 30");
  animation-duration: 5s;
  animation-delay: 1s;
}

.cpu-line-2 {
  offset-path: path("M 180 10 h -69.7 q -5 0 -5 5 v 40");
  animation-delay: 6s;
  animation-duration: 2s;
}

.cpu-line-3 {
  offset-path: path("M 130 20 v 21.8 q 0 5 -5 5 h -25");
  animation-delay: 4s;
  animation-duration: 6s;
}

.cpu-line-4 {
  offset-path: path("M 170 80 v -21.8 q 0 -5 -5 -5 h -65");
  animation-delay: 3s;
  animation-duration: 3s;
}

.cpu-line-5 {
  offset-path: path(
    "M 135 65 h 15 q 5 0 5 5 v 10 q 0 5 -5 5 h -39.8 q -5 0 -5 -5 v -35"
  );
  animation-delay: 9s;
  animation-duration: 4s;
}

.cpu-line-6 {
  offset-path: path("M 94.8 95 v -46");
  animation-delay: 3s;
  animation-duration: 7s;
}

.cpu-line-7 {
  offset-path: path(
    "M 88 88 v -15 q 0 -5 -5 -5 h -10 q -5 0 -5 -5 v -5 q 0 -5 5 -5 h 28"
  );
  animation-delay: 4s;
  animation-duration: 4s;
}

.cpu-line-8 {
  offset-path: path("M 30 30 h 25 q 5 0 5 5 v 6.5 q 0 5 5 5 h 35");
  animation-delay: 3s;
  animation-duration: 3s;
}

@keyframes animation-path {
  0% {
    offset-distance: 0%;
  }
  100% {
    offset-distance: 100%;
  }
}
