/* RadBBS Planner - Apple Neumorphic Liquid Glass Design System */
@import url('https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&display=swap');

:root {
  --font-family: 'Figtree', -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Helvetica, Arial, sans-serif;
  
  /* Mod Cerah (Default): Luxurious Frosted Ceramic & Liquid Glass */
  --bg-page: #f1f4f8;
  --bg-surface: rgba(255, 255, 255, 0.72);
  --bg-surface-elevated: #ffffff;
  --bg-cell-weekday: #ffffff;
  --bg-cell-weekend: #f4f6fa;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-tertiary: #94a3b8;
  
  /* Subtle Luxury Neumorphic Tokens (Light) */
  --neu-dark: rgba(148, 163, 184, 0.22);
  --neu-light: rgba(255, 255, 255, 0.95);
  --neu-rim: rgba(255, 255, 255, 0.9);
  --border-subtle: rgba(226, 232, 240, 0.8);
  
  --shadow-raised: 0 10px 25px -5px rgba(15, 23, 42, 0.05), 0 8px 10px -6px rgba(15, 23, 42, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  --shadow-raised-sm: 0 2px 6px -1px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --shadow-raised-hover: 0 16px 32px -6px rgba(15, 23, 42, 0.08), 0 8px 16px -4px rgba(15, 23, 42, 0.04), inset 0 1px 0 rgba(255, 255, 255, 1);
  --shadow-inset: inset 0 2px 4px 0 rgba(15, 23, 42, 0.04), inset 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-inset-sm: inset 0 1.5px 3px 0 rgba(15, 23, 42, 0.04);
  --shadow-sheet: 0 -20px 40px -10px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  
  --scrim-bg: rgba(15, 23, 42, 0.32);
  --chip-bg: #f8fafc;
}

html.dark {
  /* Mod Gelap: Sophisticated Obsidian Liquid Glass (Ultra-soft specular highlights, zero harsh drop shadows) */
  --bg-page: #0d0f12;
  --bg-surface: rgba(20, 24, 30, 0.72);
  --bg-surface-elevated: #161a22;
  --bg-cell-weekday: #151921;
  --bg-cell-weekend: #11141a;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-tertiary: #64748b;
  
  /* Subtle Luxury Neumorphic Tokens (Dark) - Natural diffuse ambient shadows with hairline specular rim */
  --neu-dark: rgba(0, 0, 0, 0.45);
  --neu-light: rgba(255, 255, 255, 0.04);
  --neu-rim: rgba(255, 255, 255, 0.12);
  --border-subtle: rgba(255, 255, 255, 0.07);
  
  --shadow-raised: 0 12px 28px -4px rgba(0, 0, 0, 0.5), 0 4px 10px -2px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --shadow-raised-sm: 0 4px 12px -2px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --shadow-raised-hover: 0 16px 36px -4px rgba(0, 0, 0, 0.65), 0 6px 14px -2px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  --shadow-inset: inset 0 2px 5px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(0, 0, 0, 0.3);
  --shadow-inset-sm: inset 0 1.5px 3.5px rgba(0, 0, 0, 0.4);
  --shadow-sheet: 0 -20px 50px -10px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  
  --scrim-bg: rgba(0, 0, 0, 0.65);
  --chip-bg: #1c212b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.28s cubic-bezier(0.32, 0.72, 0, 1), color 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  overflow-x: hidden;
}

/* Hairline border utilities */
.border-hairline {
  border: 1px solid var(--border-subtle);
}

.border-b-hairline {
  border-bottom: 1px solid var(--border-subtle);
}

.border-t-hairline {
  border-top: 1px solid var(--border-subtle);
}

/* ============================================================ */
/* NEUMORPHIC LIQUID GLASS UTILITIES                            */
/* ============================================================ */

/* Top Navigation Header: Floating Frosted Liquid Bar */
.neu-navbar {
  background: var(--bg-surface);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04), inset 0 1px 0 var(--neu-rim);
  padding-top: env(safe-area-inset-top, 0px);
}

/* Neumorphic Extruded Button / Pill */
.neu-btn {
  background: var(--bg-surface-elevated);
  box-shadow: var(--shadow-raised-sm);
  border: 1px solid var(--border-subtle);
  transition: all 0.16s cubic-bezier(0.32, 0.72, 0, 1);
  cursor: pointer;
  outline: none;
}

.neu-btn:hover {
  box-shadow: var(--shadow-raised);
  transform: translateY(-0.5px);
}

.neu-btn:active {
  box-shadow: var(--shadow-inset-sm);
  transform: translateY(0.5px);
}

/* Neumorphic Recessed Cavity (Inputs, Inset containers) */
.neu-inset {
  background: var(--bg-surface);
  box-shadow: var(--shadow-inset);
  border: 1px solid var(--border-subtle);
}

.neu-inset-sm {
  box-shadow: var(--shadow-inset-sm);
  border: 1px solid var(--border-subtle);
}

/* Raised Card / Modal Container */
.neu-card {
  background: var(--bg-surface-elevated);
  box-shadow: var(--shadow-raised);
  border: 1px solid var(--border-subtle);
}

/* ============================================================ */
/* KALENDAR GRID NEUMORPHIC                                     */
/* ============================================================ */
.calendar-grid-plate {
  padding: 5px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-inset);
  border-radius: 1.25rem;
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  border-radius: 1rem;
  overflow: hidden;
}

.calendar-cell {
  min-height: 104px;
  padding: 8px 6px;
  background-color: var(--bg-cell-weekday);
  box-shadow: var(--shadow-raised-sm);
  border-radius: 0.65rem;
  border: 1px solid var(--border-subtle);
  transition: all 0.14s cubic-bezier(0.32, 0.72, 0, 1);
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

@media (max-width: 640px) {
  .calendar-grid-plate {
    padding: 3px;
    border-radius: 1rem;
  }
  .calendar-grid {
    gap: 2px;
    border-radius: 0.85rem;
  }
  .calendar-cell {
    min-height: 76px;
    padding: 4px 2px;
    border-radius: 0.45rem;
  }
}

.calendar-cell:hover {
  transform: translateY(-0.5px);
  box-shadow: var(--shadow-raised);
  z-index: 5;
}

.calendar-cell:active {
  box-shadow: var(--shadow-inset-sm);
  transform: translateY(0.5px);
}

.calendar-cell.weekend {
  background-color: var(--bg-cell-weekend);
  opacity: 0.92;
}

.calendar-cell.outside-month {
  opacity: 0.22;
  box-shadow: none;
  background-color: transparent;
}

.calendar-cell.is-today-cell {
  border: 1.5px solid #0284c7;
  box-shadow: 0 0 0 1px #0284c7, var(--shadow-raised-sm);
}

/* Event Chip (Soft Embossed Pill) */
.event-chip {
  font-size: 0.69rem;
  line-height: 1.25;
  padding: 3px 6px;
  border-radius: 6px;
  margin-bottom: 2.5px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  cursor: pointer;
  background: var(--chip-bg);
  box-shadow: var(--shadow-raised-sm);
  border: 1px solid var(--border-subtle);
  transition: all 0.12s ease;
}

@media (max-width: 640px) {
  .event-chip {
    font-size: 0.62rem;
    padding: 2px 4px;
    margin-bottom: 2px;
    border-radius: 4px;
  }
}

.event-chip:hover {
  transform: translateY(-0.5px);
  box-shadow: var(--shadow-raised);
}

.event-chip:active {
  box-shadow: var(--shadow-inset-sm);
}

/* ============================================================ */
/* APPLE iOS LIQUID GLASS BOTTOM SHEET                          */
/* ============================================================ */
.bottom-sheet-scrim {
  position: fixed;
  inset: 0;
  background: var(--scrim-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.bottom-sheet-scrim.open {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  max-height: 88vh;
  border-top-left-radius: 2rem;
  border-top-right-radius: 2rem;
  background: var(--bg-surface);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border-top: 1px solid var(--neu-rim);
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sheet);
  transform: translateY(100%);
  transition: transform 0.36s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
}

.bottom-sheet-drawer.open {
  transform: translateY(0);
}

.drawer-drag-handle {
  width: 42px;
  height: 5px;
  border-radius: 9999px;
  background: var(--text-tertiary);
  opacity: 0.45;
  margin: 10px auto 4px auto;
  cursor: grab;
  touch-action: none;
  box-shadow: var(--shadow-inset-sm);
}

/* ============================================================ */
/* APPLE DIALOG MODAL                                           */
/* ============================================================ */
.modal-backdrop {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.liquid-modal-glass {
  background: var(--bg-surface);
  backdrop-filter: blur(36px) saturate(190%);
  -webkit-backdrop-filter: blur(36px) saturate(190%);
  box-shadow: var(--shadow-raised), inset 0 1px 0 var(--neu-rim);
  border: 1px solid var(--border-subtle);
}

/* Inputs with Neumorphic Inset */
input[type="text"],
input[type="date"],
input[type="url"],
select,
textarea {
  background: var(--bg-surface-elevated) !important;
  box-shadow: var(--shadow-inset-sm) !important;
  border: 1px solid var(--border-subtle) !important;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
  border-color: #0284c7 !important;
  box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.2), 0 0 0 1px #0284c7 !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.6);
}
