
@import "leaflet/dist/leaflet.css";

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

:root {
  color-scheme: light;
  --surface: #ffffff;
  --ink: #0f0f10;
  --muted: #f2f2ee;
  --line: #deded6;
  --accent: #6f7a4f;
  --accent-strong: #4e5837;
  --accent-glow: #aab790;
  --cool: #2f3b2a;
}

body {
  color: var(--ink);
  background:
    radial-gradient(60% 80% at 0% 0%, rgba(170, 183, 144, 0.25) 0%, transparent 60%),
    radial-gradient(60% 70% at 100% 0%, rgba(15, 15, 16, 0.08) 0%, transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent 25%),
    #f4f4f0;
  background-repeat: no-repeat;
  background-size: cover;
  font-family: "Sora", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --surface: #0f1110;
  --ink: #f8f7f2;
  --muted: #161a18;
  --line: #2b322c;
  --accent: #8e9b6b;
  --accent-strong: #a3b37a;
  --accent-glow: #3b4a2a;
  --cool: #c9d4b4;
}

html[data-theme="dark"] body {
  color: var(--ink);
  background:
    radial-gradient(70% 90% at 0% 0%, rgba(142, 155, 107, 0.22) 0%, transparent 60%),
    radial-gradient(80% 70% at 100% 0%, rgba(255, 255, 255, 0.06) 0%, transparent 60%),
    linear-gradient(180deg, rgba(15, 17, 16, 0.95), transparent 25%),
    #0b0d0c;
  background-repeat: no-repeat;
  background-size: cover;
}

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

@keyframes glow {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(255, 155, 130, 0);
  }
  50% {
    box-shadow: 0 0 40px rgba(255, 155, 130, 0.35);
  }
}

@layer components {
  .card {
    @apply rounded-2xl border border-slate-200/70 bg-white/90 p-5 shadow-[0_20px_40px_rgba(15,15,16,0.08)];
  }
  .card-muted {
    @apply rounded-2xl border border-slate-200/70 bg-white/70 p-5;
  }
  .btn-primary {
    @apply rounded-full bg-slate-900 px-4 py-2 text-sm font-semibold text-white transition hover:-translate-y-0.5 hover:bg-slate-800;
  }
  .btn-accent {
    @apply rounded-full bg-brand-500 px-4 py-2 text-sm font-semibold text-white transition hover:-translate-y-0.5 hover:bg-brand-700;
  }
  .btn-ghost {
    @apply rounded-full border border-slate-300 px-4 py-2 text-sm font-semibold text-slate-700 transition hover:-translate-y-0.5 hover:bg-slate-100;
  }
  .fade-up {
    animation: fadeUp 0.7s ease both;
  }
  .fade-up-delay {
    animation: fadeUp 0.7s ease 0.15s both;
  }
  .glow {
    animation: glow 5s ease-in-out infinite;
  }
}

html[data-theme="dark"] .card {
  border-color: rgba(71, 85, 105, 0.35);
  background: rgba(15, 17, 16, 0.9);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .card-muted {
  border-color: rgba(71, 85, 105, 0.3);
  background: rgba(15, 17, 16, 0.7);
}

html[data-theme="dark"] .btn-primary {
  background: #f8f7f2;
  color: #0f1110;
}

html[data-theme="dark"] .btn-primary:hover {
  background: #e7e4da;
}

html[data-theme="dark"] .btn-accent {
  background: var(--accent);
}

html[data-theme="dark"] .btn-accent:hover {
  background: var(--accent-strong);
}

html[data-theme="dark"] .btn-primary {
  background: #f8f7f2;
  color: #0f1110;
  border-color: rgba(148, 163, 184, 0.4);
}

html[data-theme="dark"] .btn-primary:hover {
  background: #ffffff;
}

html[data-theme="dark"] .btn-ghost {
  border-color: rgba(71, 85, 105, 0.6);
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.55);
}

html[data-theme="dark"] .btn-ghost:hover {
  background: rgba(148, 163, 184, 0.18);
}

html[data-theme="dark"] .ical-link {
  border-color: rgba(71, 85, 105, 0.5);
  background: rgba(30, 41, 59, 0.6);
}

html[data-theme="dark"] .ical-link span {
  color: #e2e8f0;
}

html[data-theme="dark"] button.text-slate-600 {
  color: #e2e8f0;
}

html[data-theme="dark"] button.text-slate-600:hover {
  color: #f8fafc;
}

html[data-theme="dark"] .list-table button {
  color: #e2e8f0;
}

html[data-theme="dark"] .list-table button:hover {
  color: #f8fafc;
}

html[data-theme="dark"] .list-table .text-slate-600 {
  color: #e2e8f0;
}

html[data-theme="dark"] .list-table svg {
  color: #e2e8f0;
}

html[data-theme="dark"] .category-pill {
  border-color: rgba(71, 85, 105, 0.6);
  background: rgba(30, 41, 59, 0.55);
  color: #e2e8f0;
}

html[data-theme="dark"] .category-pill button {
  color: #e2e8f0;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: rgba(30, 41, 59, 0.55);
  border-color: rgba(148, 163, 184, 0.45);
  color: #f8fafc;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: rgba(226, 232, 240, 0.6);
}

html[data-theme="dark"] header {
  border-color: rgba(71, 85, 105, 0.35);
  background: rgba(15, 17, 16, 0.8);
}

html[data-theme="dark"] .brand-title {
  color: #f8fafc;
}

.nav-link {
  color: #334155;
  background: transparent;
}

.nav-link:hover {
  background: #f1f5f9;
}

.nav-link-active {
  background: #0f172a;
  color: #ffffff;
}

.nav-link-active:hover {
  background: #0f172a;
  color: #ffffff;
}

html[data-theme="dark"] .nav-link {
  color: #e2e8f0;
}

html[data-theme="dark"] .nav-link:hover {
  background: rgba(148, 163, 184, 0.12);
}

html[data-theme="dark"] .nav-link-active {
  background: #f8f7f2;
  color: #0f1110;
}

html[data-theme="dark"] .nav-link-active:hover {
  background: #f8f7f2;
  color: #0f1110;
}

.mobile-menu-panel {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
}

html[data-theme="dark"] .mobile-menu-panel {
  background: rgba(30, 37, 34, 0.95);
  border-bottom-color: rgba(71, 85, 105, 0.35);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.5);
}


html[data-theme="dark"] .fc .fc-button {
  border-color: rgba(71, 85, 105, 0.5);
  background: rgba(15, 17, 16, 0.75);
  color: #f8fafc;
}

html[data-theme="dark"] .fc .fc-button-primary:not(:disabled).fc-button-active,
html[data-theme="dark"] .fc .fc-button-primary:not(:disabled):active {
  background: #f8f7f2;
  color: #0f1110;
}

html[data-theme="dark"] .fc .fc-daygrid-event,
html[data-theme="dark"] .fc .fc-timegrid-event {
  background: #e2e8f0;
  color: #0f1110;
}

html[data-theme="dark"] .fc .fc-daygrid-event .fc-event-main,
html[data-theme="dark"] .fc .fc-timegrid-event .fc-event-main,
html[data-theme="dark"] .fc .fc-daygrid-event .fc-event-title,
html[data-theme="dark"] .fc .fc-timegrid-event .fc-event-title,
html[data-theme="dark"] .fc .fc-daygrid-event .fc-event-time,
html[data-theme="dark"] .fc .fc-timegrid-event .fc-event-time {
  color: #0f1110;
}

html[data-theme="dark"] .fc .fc-day-today {
  background: rgba(248, 247, 242, 0.08);
}

html[data-theme="dark"] .fc .fc-daygrid-day.fc-day-past {
  background: rgba(148, 163, 184, 0.08);
}

html[data-theme="dark"] .fc .fc-daygrid-day.fc-day-past .fc-daygrid-day-number {
  color: rgba(226, 232, 240, 0.7);
}

html[data-theme="dark"] .list-table tr {
  border-color: rgba(71, 85, 105, 0.4);
}

html[data-theme="dark"] .list-table tr[data-bucket="past"] {
  background: rgba(30, 41, 59, 0.55);
  color: rgba(148, 163, 184, 0.9);
}

html[data-theme="dark"] .list-table tr[data-bucket="today"] {
  background: rgba(217, 119, 6, 0.18);
  color: #f8fafc;
}

html[data-theme="dark"] .list-table tr[data-bucket="tomorrow"] {
  background: rgba(16, 185, 129, 0.16);
  color: #f8fafc;
}

html[data-theme="dark"] .list-table tr[data-bucket="future"] {
  background: rgba(59, 130, 246, 0.12);
  color: #f8fafc;
}

html[data-theme="dark"] .drag-handle {
  border-color: rgba(71, 85, 105, 0.5);
  color: #e2e8f0;
  background: rgba(15, 17, 16, 0.8);
}

html[data-theme="dark"] .drag-handle:hover {
  background: rgba(30, 41, 59, 0.9);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.fc .fc-toolbar-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.fc .fc-button {
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #0f172a;
  text-transform: none;
  padding: 0.4rem 0.8rem;
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background: #0f172a;
  color: #ffffff;
}

.fc .fc-daygrid-event,
.fc .fc-timegrid-event {
  border-radius: 0.6rem;
  border: none;
  background: #e2e8f0;
  color: #0f172a;
}

.fc .fc-daygrid-event .fc-event-main,
.fc .fc-timegrid-event .fc-event-main,
.fc .fc-daygrid-event .fc-event-title,
.fc .fc-timegrid-event .fc-event-title,
.fc .fc-daygrid-event .fc-event-time,
.fc .fc-timegrid-event .fc-event-time {
  color: #0f172a;
}

.fc .fc-daygrid-event .event-shell,
.fc .fc-timegrid-event .event-shell {
  position: relative;
  padding-right: 1.75rem;
  overflow: hidden;
  max-height: 100%;
}

.fc .fc-daygrid-event .event-toggle,
.fc .fc-timegrid-event .event-toggle {
  position: absolute;
  right: 0.3rem;
  top: 0.3rem;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  padding: 0.35rem 0.55rem;
  color: #475569;
  background: #ffffff;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.drag-handle:hover {
  transform: translateY(-1px);
  background: #f8fafc;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.drag-handle:active {
  cursor: grabbing;
  transform: translateY(0);
}

.drag-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.drag-card.dragging {
  opacity: 0.7;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
}

.drag-card.drag-target {
  outline: 2px dashed rgba(99, 102, 241, 0.35);
  outline-offset: 4px;
}

.drag-card.shift-up {
  transform: translateY(-10px);
}

.drag-card.shift-down {
  transform: translateY(10px);
}

.fc .fc-day-today {
  background: rgba(31, 41, 55, 0.08);
}

.fc .fc-daygrid-day.fc-day-past {
  background: rgba(15, 23, 42, 0.03);
}

.fc .fc-daygrid-day.fc-day-past .fc-daygrid-day-number {
  color: rgba(15, 23, 42, 0.5);
}

@media (max-width: 768px) {
  .calendar-pane {
    display: none;
  }

  .fc .fc-toolbar {
    flex-direction: column;
    gap: 0.5rem;
  }

  .fc .fc-toolbar-title {
    font-size: 1rem;
  }

  .fc .fc-button {
    padding: 0.35rem 0.7rem;
    font-size: 0.75rem;
  }
}
