@import url('https://fonts.googleapis.com/css2?family=Clash+Display:wght@400;500;600;700&family=Satoshi:wght@400;500;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #14111F;
  --purple: #8B5CF6;
  --purple-light: #A78BFA;
  --purple-dark: #6D3FE0;
  --text: #F0EEF7;
  --text-muted: #9691AC;
  --white: #1D1930;
  --danger: #F87171;
  --card: rgba(29,25,48,0.75);
  --card-border: rgba(139,92,246,0.18);
  --shadow: 0 4px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.45);
  --radius: 16px;
  --radius-sm: 12px;
}

html, body { min-height: 100vh; font-family: 'Satoshi', sans-serif; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }

.nx-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; background: rgba(29,25,48,0.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--card-border); position: sticky; top: 0; z-index: 100; }
.nx-header-left { display: flex; align-items: center; gap: 10px; }
.header-logo { width: 28px; height: 28px; object-fit: contain; }
.header-brand { font-family: 'Clash Display', sans-serif; font-size: 16px; font-weight: 600; }
.nx-header-right { display: flex; align-items: center; gap: 10px; }

.btn-primary { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; background: var(--purple); color: #fff; border: none; border-radius: var(--radius-sm); font-family: 'Satoshi', sans-serif; font-size: 13px; font-weight: 700; cursor: pointer; transition: all 0.18s; }
.btn-primary:hover { background: var(--purple-dark); }
.btn-primary.full { width: 100%; justify-content: center; }
.btn-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: rgba(107,63,240,0.08); border: none; border-radius: 10px; cursor: pointer; color: var(--purple); transition: all 0.18s; flex-shrink: 0; }
.btn-icon:hover { background: rgba(107,63,240,0.16); }
.btn-icon-sm { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; border-radius: 8px; cursor: pointer; color: var(--text-muted); transition: all 0.18s; flex-shrink: 0; }
.btn-icon-sm:hover { background: rgba(107,63,240,0.08); color: var(--purple); }
.btn-danger-ghost { padding: 9px 16px; background: transparent; border: 1.5px solid rgba(229,62,62,0.25); border-radius: var(--radius-sm); font-family: 'Satoshi', sans-serif; font-size: 13px; font-weight: 600; color: var(--danger); cursor: pointer; transition: all 0.18s; }
.btn-danger-ghost:hover { background: rgba(229,62,62,0.08); }

.calendar-wrap { display: flex; height: calc(100vh - 57px); overflow: hidden; }

.kora-sidebar { width: 300px; flex-shrink: 0; background: rgba(29,25,48,0.9); border-right: 1px solid var(--card-border); display: flex; flex-direction: column; backdrop-filter: blur(8px); animation: slideIn 0.25s ease; }
.kora-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--card-border); }
.kora-title-row { display: flex; align-items: center; gap: 8px; }
.kora-icon { width: 22px; height: 22px; object-fit: contain; }
.kora-title { font-family: 'Clash Display', sans-serif; font-size: 15px; font-weight: 700; }
.kora-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.kora-msg { max-width: 90%; padding: 10px 12px; border-radius: 12px; font-size: 13px; line-height: 1.55; }
.kora-msg.kora { background: rgba(107,63,240,0.08); color: var(--text); align-self: flex-start; border-bottom-left-radius: 4px; }
.kora-msg.user { background: var(--purple); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.kora-msg.loading { opacity: 0.6; }
.kora-input-wrap { padding: 12px; border-top: 1px solid var(--card-border); display: flex; gap: 8px; }
.kora-input { flex: 1; padding: 9px 12px; background: rgba(29,25,48,0.8); border: 1.5px solid var(--card-border); border-radius: var(--radius-sm); font-family: 'Satoshi', sans-serif; font-size: 13px; color: var(--text); outline: none; }
.kora-input:focus { border-color: var(--purple); }
.btn-kora-send { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--purple); border: none; border-radius: 10px; cursor: pointer; color: #fff; transition: all 0.18s; flex-shrink: 0; }
.btn-kora-send:hover { background: var(--purple-dark); }

.calendar-main { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cal-month-title { font-family: 'Clash Display', sans-serif; font-size: 20px; font-weight: 700; text-align: center; flex: 1; }

.cal-grid-header { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; padding: 0 2px; }
.cal-grid-header span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); padding: 6px 0; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }

.cal-day { min-height: 80px; background: var(--card); border: 1px solid var(--card-border); border-radius: 12px; padding: 6px; cursor: pointer; transition: all 0.18s; display: flex; flex-direction: column; gap: 3px; backdrop-filter: blur(4px); }
.cal-day:hover { border-color: var(--purple); box-shadow: var(--shadow); }
.cal-day.other-month { opacity: 0.35; }
.cal-day.today { border-color: var(--purple); background: rgba(107,63,240,0.06); }
.cal-day.selected { border-color: var(--purple); box-shadow: 0 0 0 2px rgba(107,63,240,0.3); }
.cal-day-num { font-size: 13px; font-weight: 700; color: var(--text); }
.cal-day.today .cal-day-num { color: var(--purple); }
.cal-day-dot { width: 100%; height: 4px; border-radius: 4px; background: var(--purple); opacity: 0.7; }
.cal-day-count { font-size: 10px; color: var(--purple); font-weight: 600; }

.day-panel { position: fixed; right: 0; top: 57px; width: 280px; height: calc(100vh - 57px); background: rgba(29,25,48,0.95); border-left: 1px solid var(--card-border); backdrop-filter: blur(12px); display: flex; flex-direction: column; padding: 16px; gap: 14px; z-index: 50; animation: slideInRight 0.25s ease; box-shadow: var(--shadow-lg); }
.day-panel-header { display: flex; align-items: center; justify-content: space-between; }
.day-panel-title { font-family: 'Clash Display', sans-serif; font-size: 16px; font-weight: 700; }
.day-events { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.day-event-item { background: rgba(107,63,240,0.06); border: 1px solid var(--card-border); border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer; transition: all 0.15s; }
.day-event-item:hover { border-color: var(--purple); }
.day-event-time { font-size: 11px; color: var(--purple); font-weight: 700; margin-bottom: 3px; }
.day-event-title { font-size: 14px; font-weight: 600; }
.day-event-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.day-event-shared { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.day-empty { text-align: center; padding: 30px 0; color: var(--text-muted); font-size: 13px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(26,16,40,0.5); backdrop-filter: blur(4px); z-index: 200; display: flex; align-items: flex-end; justify-content: center; }
.modal-overlay.hidden { display: none; }
.modal { width: 100%; max-width: 480px; background: var(--white); border-radius: var(--radius) var(--radius) 0 0; padding: 20px; display: flex; flex-direction: column; gap: 16px; animation: slideUp 0.3s cubic-bezier(0.22,1,0.36,1); max-height: 90vh; overflow-y: auto; }
@media (min-width: 520px) { .modal-overlay { align-items: center; } .modal { border-radius: var(--radius); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-family: 'Clash Display', sans-serif; font-size: 18px; font-weight: 700; }
.modal-body { display: flex; flex-direction: column; gap: 10px; }
.modal-footer { display: flex; gap: 10px; }
.modal-footer .btn-primary { flex: 1; justify-content: center; }

.nx-input { width: 100%; padding: 11px 14px; background: rgba(29,25,48,0.8); border: 1.5px solid var(--card-border); border-radius: var(--radius-sm); font-family: 'Satoshi', sans-serif; font-size: 14px; color: var(--text); outline: none; transition: border-color 0.18s; }
.nx-input:focus { border-color: var(--purple); }
.input-row { display: flex; gap: 8px; }
.input-row .nx-input { flex: 1; }
.form-error { font-size: 13px; color: var(--danger); min-height: 18px; }

.share-section { display: flex; flex-direction: column; gap: 8px; }
.share-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.share-input-row { display: flex; gap: 8px; }
.share-list { display: flex; flex-wrap: wrap; gap: 6px; }
.share-chip { display: flex; align-items: center; gap: 6px; background: rgba(107,63,240,0.08); border: 1px solid var(--card-border); border-radius: 20px; padding: 4px 10px; font-size: 12px; font-weight: 500; }
.share-chip button { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 14px; line-height: 1; padding: 0; }

.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px); background: #2A2440; color: #F0EEF7; padding: 10px 20px; border-radius: 10px; font-size: 13px; font-weight: 500; opacity: 0; pointer-events: none; transition: all 0.25s; z-index: 999; white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideIn { from { transform: translateX(-20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

@media (max-width: 600px) {
  .kora-sidebar { position: fixed; inset: 57px 0 0 0; width: 100%; z-index: 80; }
  .day-panel { width: 100%; }
  .cal-day { min-height: 60px; }
  .cal-day-num { font-size: 12px; }
}
