/* Sked AI - Design System & Modern Aesthetics */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Dark Luxury Theme (Default) */
  --bg-primary: #0a0d14;
  --bg-secondary: #111726;
  --bg-card: rgba(19, 27, 44, 0.75);
  --bg-card-hover: rgba(26, 37, 60, 0.85);
  --bg-glass: rgba(16, 23, 38, 0.8);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 30px -4px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 24px rgba(99, 102, 241, 0.25);

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: rgba(99, 102, 241, 0.6);

  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-image: 
    radial-gradient(circle at 15% 5%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 95%, rgba(6, 182, 212, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
}

/* ==================== LOGIN SCREEN STYLES ==================== */
.login-view-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background-image: 
    radial-gradient(circle at 50% 20%, rgba(99, 102, 241, 0.22) 0%, transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.15) 0%, transparent 50%);
}

.login-card {
  max-width: 480px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: fadeInScale 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.login-brand-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-logo-badge {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.login-logo-badge svg {
  width: 28px;
  height: 28px;
  color: #ffffff;
}

.login-app-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text-main) 40%, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-app-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.login-prompt-heading {
  margin-bottom: 1.25rem;
  text-align: center;
}

.login-prompt-heading h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.login-prompt-heading p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.login-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.login-input {
  width: 100% !important;
  padding: 0.85rem 1.15rem !important;
  font-size: 1rem !important;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.login-hint {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  display: block;
  line-height: 1.4;
}

.login-error-msg {
  font-size: 0.78rem;
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.25);
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  margin-top: 0.5rem;
}

/* Quick Defaults Section on Login Screen */
.login-defaults-section {
  margin-top: 1.5rem;
}

.login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin-bottom: 1rem;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.login-divider span {
  padding: 0 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.login-defaults-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.btn-quick-login {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}

.btn-quick-login:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.quick-icon {
  font-size: 1.4rem;
}

.quick-meta {
  display: flex;
  flex-direction: column;
}

.quick-title {
  font-weight: 800;
  font-size: 0.95rem;
}

.quick-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.2;
}

/* ==================== MAIN APP STYLES ==================== */
.app-view-wrapper {
  animation: fadeIn 0.25s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.5rem;
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.logo-badge svg {
  width: 22px;
  height: 22px;
  color: #ffffff;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-main) 60%, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: -2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-header {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 36px;
  padding: 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  color: var(--text-main);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  box-sizing: border-box;
  white-space: nowrap;
  transition: var(--transition);
}

.btn-header:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.user-profile-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 36px;
  padding: 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1;
  color: var(--text-main);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  box-sizing: border-box;
  white-space: nowrap;
}

.user-avatar-icon {
  font-size: 0.95rem;
}

.user-label-text {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.user-badge-name {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--accent-cyan);
  letter-spacing: -0.01em;
}

.btn-logout {
  background: rgba(255, 255, 255, 0.05);
}

.btn-logout:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-add-event {
  background: var(--accent-primary);
  color: #ffffff;
  border: 1px solid transparent;
  box-shadow: 0 1px 4px rgba(99, 102, 241, 0.3);
}

.btn-add-event:hover {
  background: var(--accent-primary-hover);
  border-color: transparent;
  transform: translateY(-1px);
}

#btn-theme-toggle {
  width: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

/* User Welcome Banner */
.user-welcome-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.12) 0%, rgba(6, 182, 212, 0.08) 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  backdrop-filter: blur(8px);
}

.user-welcome-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.welcome-label {
  color: var(--text-secondary);
}

#banner-username {
  color: var(--accent-cyan);
  font-size: 1.05rem;
  font-weight: 800;
}

.welcome-note {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-switch-inline {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-switch-inline:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  color: var(--accent-cyan);
}

/* Main Container */
.main-layout {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Prompt Card */
.prompt-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.prompt-panel:focus-within {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-glow);
}

.prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.prompt-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.prompt-multilingual-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Unified Schedule Input Box with Integrated Attach Button */
.prompt-box-container {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.prompt-box-container:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.prompt-box-container.drag-active {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.25);
}

/* Multiple Image Previews Strip */
.image-previews-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.15);
}

.image-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
  color: var(--text-main);
  animation: fadeIn 0.18s ease;
}

.image-chip-thumb {
  width: 26px;
  height: 26px;
  object-fit: cover;
  border-radius: 4px;
}

.image-chip-name {
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.btn-chip-remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.2rem;
  cursor: pointer;
  border-radius: 3px;
  transition: var(--transition);
}

.btn-chip-remove:hover {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.15);
}

/* Prompt Textarea Wrapper & Textarea */
.prompt-textarea-wrapper {
  position: relative;
  display: flex;
}

.prompt-textarea {
  width: 100%;
  min-height: 84px;
  max-height: 220px;
  padding: 0.85rem 3.25rem 0.85rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  background: transparent;
  border: none;
  color: var(--text-main);
  resize: none;
  outline: none;
  line-height: 1.6;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

/* Sleek Custom Scrollbar (wheel only shows on overflow, never default white) */
.prompt-textarea::-webkit-scrollbar {
  width: 6px;
}

.prompt-textarea::-webkit-scrollbar-track {
  background: transparent;
}

.prompt-textarea::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-full);
}

.prompt-textarea::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

[data-theme="light"] .prompt-textarea {
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

[data-theme="light"] .prompt-textarea::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .prompt-textarea::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* Inside Attach Button */
.prompt-inside-actions {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
}

.btn-attach-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-attach-icon:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
  transform: translateY(-1px);
}

.prompt-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.prompt-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.prompt-controls-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Append Mode Toggle Switch */
.append-mode-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  user-select: none;
}

.append-mode-label input {
  display: none;
}

.append-switch {
  width: 36px;
  height: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  position: relative;
  transition: var(--transition);
  display: inline-block;
}

.append-switch::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: var(--transition);
}

.append-mode-label input:checked + .append-switch {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.append-mode-label input:checked + .append-switch::before {
  transform: translateX(16px);
  background: #ffffff;
}

.append-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.append-text strong {
  color: var(--text-main);
}

.btn-generate {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  transition: var(--transition);
}

.btn-generate:hover:not(:disabled) {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.55);
  transform: translateY(-1px);
}

.btn-generate:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Schedule Container & View Switcher */
.schedule-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.schedule-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 1rem;
  background: rgba(17, 24, 38, 0.5);
}

.view-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-secondary);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.schedule-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-main);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.btn-action:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-action.primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.btn-action.primary:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* View Content */
.view-content {
  padding: 1.25rem;
  min-height: 480px;
}

/* Timetable Grid View */
.timetable-wrapper {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.timetable-header-row {
  display: grid;
  grid-template-columns: 75px repeat(7, minmax(130px, 1fr));
  border-bottom: 2px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  position: sticky;
  top: 0;
  z-index: 10;
}

.timetable-corner-cell {
  padding: 0.85rem 0.5rem;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  border-right: 1px solid var(--border-color);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timetable-header-cell {
  padding: 0.85rem 0.5rem;
  text-align: center;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.timetable-header-cell:last-child {
  border-right: none;
}

.timetable-header-cell.is-today {
  background: rgba(99, 102, 241, 0.1);
}

.day-short {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.day-full {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.today-badge {
  font-size: 0.6rem;
  background: var(--accent-primary);
  color: #fff;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  font-weight: 800;
  margin-top: 2px;
}

/* Timetable Body */
.timetable-body {
  display: grid;
  grid-template-columns: 75px 1fr;
  position: relative;
  min-height: 600px;
}

.timetable-time-col {
  border-right: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.01);
  display: flex;
  flex-direction: column;
}

.timetable-time-slot {
  flex: 1;
  min-height: 50px;
  padding: 0.35rem 0.5rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-align: right;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.timetable-days-container {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  position: relative;
}

.timetable-day-column {
  border-right: 1px solid var(--border-color);
  position: relative;
  display: flex;
  flex-direction: column;
}

.timetable-day-column:last-child {
  border-right: none;
}

.timetable-day-column.is-today {
  background: rgba(99, 102, 241, 0.03);
}

.timetable-hour-slot {
  flex: 1;
  min-height: 50px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

/* Event Block in Timetable */
.timetable-event-block {
  position: absolute;
  width: calc(100% - 6px);
  left: 3px;
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  color: #ffffff;
  border-left: 4px solid;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(0, 0, 0, 0.15) 100%);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease, width 0.18s ease, left 0.18s ease, z-index 0.1s ease;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.timetable-event-block:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  z-index: 20 !important;
}

/* Overlapping Event Blocks */
.timetable-event-block.is-overlapping {
  padding: 0.35rem 0.45rem;
  border-left-width: 3px;
  font-size: 0.8rem;
}

.timetable-event-block.is-overlapping:hover {
  width: calc(100% - 6px) !important;
  left: 3px !important;
  z-index: 40 !important;
  transform: scale(1.03);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 16px rgba(99, 102, 241, 0.3);
}

.event-block-inner {
  overflow: hidden;
}

.event-time-pill {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  font-weight: 700;
  opacity: 0.9;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.event-title {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-location {
  font-size: 0.7rem;
  opacity: 0.85;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-category-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-full);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Clean Graphic Export: suppress TODAY indicator and day highlights */
.timetable-wrapper.is-exporting .today-badge {
  display: none !important;
}

.timetable-wrapper.is-exporting .timetable-header-cell.is-today,
.timetable-wrapper.is-exporting .timetable-day-column.is-today {
  background: transparent !important;
}

/* Modal Event Delete Button */
.btn-delete-modal {
  margin-right: auto;
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.35);
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-delete-modal:hover {
  background: rgba(244, 63, 94, 0.28);
  border-color: rgba(244, 63, 94, 0.6);
  color: #fff;
}

/* Agenda View */
.agenda-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 900px;
  margin: 0 auto;
}

.agenda-day-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.agenda-day-section.is-today {
  border-color: var(--accent-primary);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.05) 0%, var(--bg-secondary) 100%);
}

.agenda-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.agenda-day-header h4 {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
}

.agenda-today-pill {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--accent-primary);
  color: #ffffff;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  margin-left: 0.5rem;
  letter-spacing: 0.04em;
  display: inline-block;
}

.agenda-day-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.agenda-events-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.agenda-event-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 5px solid;
  border-radius: var(--radius-sm);
  gap: 1.25rem;
}

.agenda-card-time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  flex: 0 0 210px;
  width: 210px;
  min-width: 210px;
  max-width: 210px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.agenda-card-body {
  flex: 1;
}

.agenda-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.agenda-card-meta, .agenda-card-notes {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.agenda-card-actions {
  display: flex;
  gap: 0.4rem;
}

.btn-agenda-action {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  font-family: inherit;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}

.btn-agenda-action:hover {
  background: var(--bg-card-hover);
}

/* Manageable Data Table View */
.data-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

.data-table tr:hover td {
  background: var(--bg-card-hover);
}

.badge-day {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-right: 3px;
}

.color-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

/* JSON Viewer View */
.json-viewer-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.json-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.json-code-box {
  background: #0d1117;
  color: #58a6ff;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow-x: auto;
  line-height: 1.6;
  max-height: 500px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.2rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.9rem;
  max-width: 480px;
  margin: 0 auto;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.2s ease;
}

.modal-backdrop.open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
}

.form-control:focus {
  border-color: var(--accent-primary);
}

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 14px;
  padding-right: 2.25rem;
  cursor: pointer;
}

select.form-control option {
  background: var(--bg-secondary);
  color: var(--text-main);
  padding: 0.5rem;
}

.day-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.day-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  user-select: none;
}

.day-checkbox-label:has(input:checked) {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

.day-checkbox-label input {
  display: none;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn-secondary {
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-primary {
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--accent-primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-secondary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: slideIn 0.25s ease forwards;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast.success {
  border-left: 4px solid var(--accent-emerald);
}

.toast.error {
  border-left: 4px solid var(--accent-rose);
}

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

/* Responsive Mobile & Tablet Support */
@media (max-width: 860px) {
  .header-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.4rem;
  }
  .prompt-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .btn-generate {
    width: 100%;
    justify-content: center;
  }
  .schedule-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }
  .view-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    padding-bottom: 2px;
  }
  .schedule-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    width: 100%;
    gap: 0.4rem;
  }
  .main-layout {
    padding: 1rem 0.75rem;
  }
  .prompt-panel {
    padding: 1rem;
  }
  .timetable-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .timetable-header-row,
  .timetable-body {
    min-width: 700px;
  }
}

@media (max-width: 640px) {
  .agenda-event-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }
  .agenda-card-time {
    width: 100%;
    flex: none;
    min-width: 0;
    max-width: none;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .agenda-card-actions {
    align-self: flex-end;
  }
}

@media (max-width: 520px) {
  .brand-title {
    font-size: 1.2rem;
  }
  .brand-subtitle {
    font-size: 0.7rem;
  }
  .btn-header, .user-profile-badge {
    height: 34px;
    padding: 0 0.55rem;
    font-size: 0.76rem;
  }
  .schedule-actions {
    grid-template-columns: 1fr 1fr;
  }
  .btn-action {
    padding: 0.45rem 0.5rem;
    font-size: 0.75rem;
    justify-content: center;
  }
  .login-card {
    padding: 1.5rem 1.15rem;
    margin: 0.75rem;
    width: calc(100% - 1.5rem);
  }
  .modal-card {
    margin: 0.75rem;
    padding: 1.25rem 1rem;
    max-height: 92vh;
  }
  .modal-footer {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .btn-delete-modal {
    width: 100%;
    justify-content: center;
    order: 3;
    margin-right: 0;
  }
}

/* Clear Input Button */
.btn-clear-input {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-clear-input:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
  background: var(--bg-card-hover);
}

/* Event Types, Deadlines & Badges */
.event-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  margin-bottom: 2px;
}

.event-tags-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 4px;
}

.event-badge, .agenda-type-badge, .badge-type {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.12rem 0.4rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
  display: inline-block;
}

.event-badge.deadline,
.agenda-type-badge.deadline,
.badge-type.deadline {
  background: rgba(244, 63, 94, 0.2);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.event-badge.onetime,
.agenda-type-badge.onetime,
.badge-type.onetime {
  background: rgba(6, 182, 212, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.badge-type.weekly {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.event-date-tag {
  font-size: 0.65rem;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-weight: 700;
}

.timetable-event-block.is-deadline {
  border-left-style: dashed;
  border-left-width: 4px;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.3);
}

.timetable-event-block.is-one-time {
  border-left-style: dotted;
  border-left-width: 4px;
}

.agenda-event-card.is-deadline {
  border-left-style: dashed;
}

.agenda-card-date {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  margin-top: 2px;
}

/* ==================== FLOATING SUGGESTION BUTTON (LOWER-LEFT) ==================== */
.feedback-fab {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 85;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.95rem;
  height: 42px;
  background: var(--bg-card);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-full);
  color: var(--text-main);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 12px rgba(99, 102, 241, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.feedback-fab svg {
  color: var(--accent-cyan);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.feedback-fab-label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.feedback-fab:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: var(--accent-cyan);
  background: var(--bg-card-hover);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.35);
}

.feedback-fab:hover svg {
  transform: rotate(-10deg) scale(1.1);
}

.modal-feedback-card {
  max-width: 460px;
}

.modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.feedback-textarea {
  resize: none;
  min-height: 100px;
  font-family: inherit;
  line-height: 1.5;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.feedback-textarea::-webkit-scrollbar {
  width: 6px;
}

.feedback-textarea::-webkit-scrollbar-track {
  background: transparent;
}

.feedback-textarea::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-full);
}

.feedback-textarea::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

@media (max-width: 520px) {
  .feedback-fab {
    bottom: 16px;
    left: 16px;
    padding: 0;
    width: 40px;
    height: 40px;
    justify-content: center;
  }
  .feedback-fab-label {
    display: none;
  }
}

