/* css/style.css */

/* Custom scrollbar for clean look */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}
.dark ::-webkit-scrollbar-thumb {
  background: #234248;
}

/* Custom scrollbar hide for horizontal scrolling */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Common UI adjustments */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Subtle, Premium Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes zoomInFade {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

.animate-slide-up {
  animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-zoom-in {
  animation: zoomInFade 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Staggered text delays for lists */
.stagger-1 {
  animation-delay: 0.05s;
  opacity: 0;
}
.stagger-2 {
  animation-delay: 0.1s;
  opacity: 0;
}
.stagger-3 {
  animation-delay: 0.15s;
  opacity: 0;
}
.stagger-4 {
  animation-delay: 0.2s;
  opacity: 0;
}
.stagger-5 {
  animation-delay: 0.25s;
  opacity: 0;
}
.stagger-6 {
  animation-delay: 0.3s;
  opacity: 0;
}
.stagger-7 {
  animation-delay: 0.35s;
  opacity: 0;
}

/* Statistics & Charts Animations */
@keyframes growWidth {
  from { width: 0; opacity: 0; }
  to { opacity: 1; }
}

@keyframes growHeight {
  from { height: 0; opacity: 0; }
  to { opacity: 1; }
}

@keyframes dashoffset {
  from { stroke-dashoffset: 100; }
  to { stroke-dashoffset: var(--dash-offset); }
}

.animate-grow-width {
  animation: growWidth 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-grow-height {
  animation: growHeight 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-donut {
  animation: dashoffset 1s ease-out forwards;
}

/* Glassmorphism for charts */
.glass-panel {
  background: rgba(25, 47, 51, 0.4);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.dark .glass-panel {
  background: rgba(17, 31, 34, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.chart-gradient-teal {
  background: linear-gradient(180deg, #22d3ee 0%, #0891b2 100%);
}

.chart-gradient-blue {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
}

.progress-shimmer {
  position: relative;
  overflow: hidden;
}

.progress-shimmer::after {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: translateX(-100%);
  animation: shimmer 2s infinite;
}

@keyframes entrance {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.animate-enter {
  animation: entrance 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fill-1 {
  font-variation-settings: 'FILL' 1;
}

/* Page transition styles */
.page-enter {
  animation: fadeIn 0.25s ease-out forwards;
}

/* General Layout Fixes */
body {
  min-height: max(600px, 100dvh);
}

/* Premium Dropdown Styles */
.select-premium {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.25em;
  padding-right: 3rem !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dark .select-premium {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2322d3ee'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}

.select-premium:focus {
  border-color: #22d3ee;
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.15);
  transform: translateY(-1px);
}

.select-premium option {
  background-color: #ffffff;
  color: #0f1719;
  padding: 12px;
}

.dark .select-premium option {
  background-color: #1a2f35;
  color: #ffffff;
}

/* Drag & Drop Reorder */
.drag-handle {
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.drag-handle:active {
  cursor: grabbing;
}

.arancel-item-row {
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.18s ease,
              opacity 0.18s ease;
}

.arancel-item-row.dragging {
  opacity: 0.85;
  transform: scale(1.02);
  box-shadow: 0 8px 32px rgba(19, 200, 236, 0.18), 0 2px 8px rgba(0,0,0,0.15);
  z-index: 100;
  border-radius: 12px;
  background: #192a2e;
}

.arancel-item-row.drag-over {
  border-top: 2px solid #13c8ec;
}

/* Fade Out Animation */
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
.animate-fade-out {
  animation: fadeOut 0.2s ease-out forwards;
}

/* Zoom Out Animation */
@keyframes zoomOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.95); }
}
.animate-zoom-out {
  animation: zoomOut 0.2s ease-out forwards;
}

/* Import dropzone */
.import-dropzone {
  border: 2px dashed #334155;
  transition: all 0.25s ease;
}
.import-dropzone:hover,
.import-dropzone.drag-active {
  border-color: #13c8ec;
  background: rgba(19, 200, 236, 0.05);
}
.import-dropzone.drag-active {
  transform: scale(1.01);
  box-shadow: 0 0 24px rgba(19, 200, 236, 0.12);
}

/* Shimmer animation for loading */
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ═══════════════════════════════════════════════════════════════
   JOB CALENDAR STYLES
   ═══════════════════════════════════════════════════════════════ */

.cal-container {
  padding: 0 0 8px;
}

/* ── Compact Toolbar (nav + mode in one row) ─────────────────── */
.cal-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 0 8px;
}
.cal-nav-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: #64748b;
  transition: all 0.15s;
  flex-shrink: 0;
}
.cal-nav-btn:hover { background: rgba(19,200,236,0.08); color: #13c8ec; }
.cal-nav-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: capitalize;
  white-space: nowrap;
}
.dark .cal-nav-label { color: #fff; }
.cal-today-btn {
  font-size: 9px; font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(19,200,236,0.1);
  color: #13c8ec;
  transition: all 0.15s;
  flex-shrink: 0;
  margin-right: auto;
}
.cal-today-btn:hover { background: rgba(19,200,236,0.2); }

/* ── Mode toggle (Mes/Semana inside toolbar) ─────────────────── */
.cal-mode-toggle {
  display: flex;
  gap: 2px;
  padding: 2px;
  background: #f1f5f9;
  border-radius: 8px;
  flex-shrink: 0;
  margin-left: auto;
}
.dark .cal-mode-toggle { background: #192a2e; }
.cal-mode-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 28px;
  font-size: 11px; font-weight: 700;
  border-radius: 6px;
  color: #94a3b8;
  transition: all 0.15s;
}
.dark .cal-mode-btn { color: #64748b; }
.cal-mode-active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.dark .cal-mode-active {
  background: #234248;
  color: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

/* ── View Mode Toggle (List / Calendar) ──────────────────────── */
.view-mode-toggle {
  display: flex;
  gap: 2px;
  padding: 2px;
  background: #f1f5f9;
  border-radius: 8px;
}
.dark .view-mode-toggle { background: #192a2e; }
.view-mode-btn {
  display: flex; align-items: center; justify-content: center; gap: 2px;
  padding: 5px 8px;
  font-size: 11px; font-weight: 700;
  border-radius: 6px;
  color: #94a3b8;
  transition: all 0.15s;
}
.dark .view-mode-btn { color: #92c0c9; }
.view-mode-btn.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.dark .view-mode-btn.active {
  background: #234248;
  color: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ── MONTH GRID ──────────────────────────────────────────────── */
.cal-header-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}
.cal-header-cell {
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  padding: 6px 0;
}
.dark .cal-header-cell { color: #64748b; }

.cal-body-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-cell {
  position: relative;
  min-height: 56px;
  padding: 5px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: all 0.15s;
}
.dark .cal-cell {
  background: #192a2e;
  border-color: #234248;
}
.cal-cell-empty { background: transparent; border-color: transparent; }
.dark .cal-cell-empty { background: transparent; border-color: transparent; }

.cal-cell-has-jobs { cursor: pointer; }
.cal-cell-has-jobs:hover {
  border-color: #13c8ec;
  box-shadow: 0 2px 12px rgba(19,200,236,0.10);
  transform: translateY(-1px);
}
.cal-cell-today {
  border-color: #13c8ec !important;
  box-shadow: 0 0 0 1px rgba(19,200,236,0.2), inset 0 0 0 1px rgba(19,200,236,0.08);
}
.cal-cell-past {
  opacity: 0.5;
}

.cal-day-num {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  line-height: 1;
}
.dark .cal-day-num { color: #cbd5e1; }
.cal-cell-today .cal-day-num {
  background: #13c8ec;
  color: #0D1E20;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  font-weight: 900;
  font-size: 10px;
}

.cal-dots-row {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: auto;
  padding-top: 2px;
}
.cal-dot {
  width: 7px; height: 7px;
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}
.cal-dot-overflow {
  font-size: 8px;
  font-weight: 800;
  color: #94a3b8;
  line-height: 7px;
}
.cal-day-count {
  position: absolute;
  top: 4px; right: 5px;
  font-size: 9px;
  font-weight: 900;
  color: #13c8ec;
  background: rgba(19,200,236,0.1);
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
}

/* ── WEEK GRID ───────────────────────────────────────────────── */
.cal-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
/* On mobile: show scrollable horizontal */
@media (max-width: 640px) {
  .cal-week-grid {
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    scroll-behavior: smooth;
  }
  .cal-week-grid::-webkit-scrollbar { display: none; }
}

.cal-weekcol {
  display: flex; flex-direction: column;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #f1f5f9;
  min-height: 180px;
  overflow: hidden;
  transition: border-color 0.15s;
}
.dark .cal-weekcol { background: #192a2e; border-color: #234248; }
.cal-weekcol-today { border-color: #13c8ec !important; }
.cal-weekcol-past { opacity: 0.6; }

.cal-weekcol-head {
  display: flex; align-items: center; justify-content: center;
  gap: 4px;
  padding: 7px 4px 6px;
  border-bottom: 1px solid #f1f5f9;
}
.dark .cal-weekcol-head { border-bottom-color: #234248; }

.cal-weekcol-dayname {
  font-size: 10px; font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}
.cal-weekcol-date {
  font-size: 16px; font-weight: 900;
  color: #1e293b;
}
.dark .cal-weekcol-date { color: #e2e8f0; }
.cal-weekcol-date-today {
  background: #13c8ec;
  color: #0D1E20 !important;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  font-size: 13px;
}
.cal-weekcol-badge {
  font-size: 9px; font-weight: 900;
  color: #13c8ec;
  background: rgba(19,200,236,0.12);
  padding: 1px 5px;
  border-radius: 5px;
}

.cal-weekcol-body {
  flex: 1;
  padding: 6px;
  display: flex; flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  scrollbar-width: none;
}
.cal-weekcol-body::-webkit-scrollbar { display: none; }
.cal-weekcol-empty {
  display: flex; align-items: center; justify-content: center;
  flex: 1;
  color: #cbd5e1;
  font-size: 14px;
}
.dark .cal-weekcol-empty { color: #334155; }

/* ── Week Job Card ───────────────────────────────────────────── */
.cal-week-card {
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.cal-week-card:hover {
  transform: scale(1.02);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.cal-week-card:active { transform: scale(0.98); }

.cal-week-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2px;
}
.cal-week-card-id {
  font-size: 9px; font-weight: 900;
  color: #64748b;
}
.dark .cal-week-card-id { color: #94a3b8; }
.cal-week-card-status {
  font-size: 8px; font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cal-week-card-patient {
  font-size: 11px; font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}
.dark .cal-week-card-patient { color: #f1f5f9; }
.cal-week-card-meta {
  font-size: 9px; font-weight: 500;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

/* ── Legend ───────────────────────────────────────────────────── */
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 14px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 10px;
}
.dark .cal-legend { background: #192a2e; }
.cal-legend-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 600;
  color: #64748b;
}
.dark .cal-legend-item { color: #94a3b8; }
.cal-legend-dot {
  width: 8px; height: 8px;
  border-radius: 3px;
  flex-shrink: 0;
}
