@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --secondary: #0f172a;
  --accent: #06b6d4;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg-gradient);
  min-height: 100vh;
  color: #f8fafc;
}

/* Glassmorphism utility */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.3);
}
::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.7);
}

/* Canvas Annotation CSS overrides */
#pdf-container {
  position: relative;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.5);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  overflow: hidden;
}

.annotation-item {
  position: absolute;
  border: 2px dashed #6366f1;
  background: rgba(99, 102, 241, 0.15);
  cursor: move;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background-color 0.2s;
  box-sizing: border-box;
}

.annotation-item.active {
  border-color: #06b6d4;
  background: rgba(6, 182, 212, 0.2);
}

.annotation-item .resize-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #06b6d4;
  border: 1px solid #ffffff;
  border-radius: 50%;
  right: -5px;
  bottom: -5px;
  cursor: se-resize;
}

.annotation-item .delete-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 18px;
  height: 18px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid white;
  opacity: 0;
  transition: opacity 0.2s;
}

.annotation-item:hover .delete-btn {
  opacity: 1;
}

/* Animations */
@keyframes slideIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.animate-slide-in {
  animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- THEME STYLING --- */

/* Light Theme Variables */
:root {
  --light-bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  --light-glass-bg: rgba(255, 255, 255, 0.7);
  --light-glass-border: rgba(15, 23, 42, 0.08);
  --light-color: #0f172a;
}

/* Light Theme Overrides */
.light-theme {
  color: var(--light-color) !important;
}

body.light-theme {
  background: var(--light-bg-gradient) !important;
  color: var(--light-color) !important;
}

/* Panel and card overrides */
.light-theme .glass-panel {
  background: var(--light-glass-bg) !important;
  border-color: var(--light-glass-border) !important;
  box-shadow: 0 8px 32px 0 rgba(15, 23, 42, 0.08) !important;
}

/* Override utility text colors */
.light-theme .text-slate-100,
.light-theme .text-slate-200,
.light-theme .text-slate-350,
.light-theme .text-slate-300,
.light-theme .text-slate-400,
.light-theme .text-slate-500,
.light-theme .text-gray-300,
.light-theme .text-gray-400 {
  color: #334155 !important;
}

.light-theme .text-indigo-400 {
  color: #4f46e5 !important;
}

.light-theme .text-indigo-300 {
  color: #3730a3 !important;
}

.light-theme .text-emerald-400 {
  color: #047857 !important;
}

.light-theme .text-amber-400 {
  color: #b45309 !important;
}

.light-theme .text-fuchsia-400 {
  color: #a21caf !important;
}

.light-theme .text-rose-400 {
  color: #be123c !important;
}

/* Backgrounds & cards overrides */
.light-theme .bg-slate-900\/50,
.light-theme .bg-slate-950,
.light-theme .bg-slate-900,
.light-theme .bg-slate-800,
.light-theme .bg-slate-850,
.light-theme .bg-slate-800\/50,
.light-theme .bg-slate-700\/50,
.light-theme .bg-indigo-950\/30 {
  background-color: rgba(241, 245, 249, 0.75) !important;
  color: #0f172a !important;
}

/* Hover styles override */
.light-theme .hover\:bg-slate-800\/50:hover,
.light-theme .hover\:bg-slate-800:hover,
.light-theme .hover\:bg-indigo-650\/20:hover {
  background-color: rgba(226, 232, 240, 0.9) !important;
}

/* Inputs, Select, Textareas */
.light-theme input,
.light-theme select,
.light-theme textarea {
  background-color: rgba(255, 255, 255, 0.9) !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

.light-theme input::placeholder {
  color: #94a3b8 !important;
}

.light-theme input:focus,
.light-theme select:focus,
.light-theme textarea:focus {
  border-color: #4f46e5 !important;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2) !important;
}

/* Table styling for light theme */
.light-theme th {
  background-color: rgba(226, 232, 240, 0.8) !important;
  color: #1e293b !important;
}

.light-theme td {
  border-bottom-color: rgba(15, 23, 42, 0.06) !important;
}

.light-theme tr:hover {
  background-color: rgba(241, 245, 249, 0.5) !important;
}

/* Borders */
.light-theme .border-slate-800\/80,
.light-theme .border-slate-800,
.light-theme .border-slate-700\/50,
.light-theme .border-slate-700\/60,
.light-theme .border-slate-700 {
  border-color: rgba(15, 23, 42, 0.08) !important;
}

/* Quick demo card tweaks */
.light-theme .bg-slate-850 {
  background-color: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
}

/* Document Annotation Editor View overrides */
.light-theme #pdf-container {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

