/* Custom transitions and animations for LaCarrera Premium */
:root {
  --primary-color: #F25C29;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

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

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

::-webkit-scrollbar-thumb {
  background: rgba(242, 92, 41, 0.2);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(242, 92, 41, 0.5);
}

/* Interactive elements refinements */
.nav-tab.active {
  pointer-events: none;
}

/* Tab Switching visibility (managed by app.js class toggles) */
.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

#treinos-view.view-section.active {
  display: flex;
}

/* Native form elements overrides for dark mode consistency */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0);
}

.dark input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

/* Fix for native select dropdown in dark mode */
.dark select option {
  background-color: #2D2D2D;
  color: #FFFFFF;
}

/* Specific fix for Status Filter integrated in search bar */
#students-status-filter {
  background-color: transparent !important;
  color: #8B8B8B;
  color-scheme: dark;
}

#students-status-filter:hover {
  color: #FFFFFF;
}

#students-status-filter option {
  background-color: #1A1A1A;
  color: #FFFFFF;
}

/* Remove default focus ring */
select:focus {
  outline: none;
  box-shadow: none;
}

/* Modal Base Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

/* Modal specific z-indexing if needed beyond tailwind */
#student-modal {
  z-index: 1000;
}

#new-student-modal,
#new-workout-modal,
#new-race-modal {
  z-index: 1100;
}

/* Mobile Sidebar Drawer */
@media (max-width: 767px) {
  .sidebar-mobile {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    z-index: 2000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex !important;
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.2);
  }

  .sidebar-mobile.active {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1990;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .sidebar-overlay.active {
    display: block;
    opacity: 1;
  }
}

/* Table Responsiveness Utility */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
html:not(.dark) body {
  background-color: #f4f7fb !important;
  color: #0f172a !important;
}

html:not(.dark) #sidebar {
  background-color: #ffffff !important;
  border-color: #d9e1ec !important;
}

html:not(.dark) header {
  background-color: #ffffff !important;
  border-color: #d9e1ec !important;
}

html:not(.dark) #view-title,
html:not(.dark) #view-title-static {
  color: #0f172a !important;
}

html:not(.dark) #sidebar .text-white {
  color: #0f172a !important;
}

html:not(.dark) #sidebar .text-text-muted-dark,
html:not(.dark) #sidebar .text-text-muted-light,
html:not(.dark) header .text-text-muted-dark,
html:not(.dark) header .text-text-muted-light {
  color: #64748b !important;
}

html:not(.dark) header input[type="text"] {
  background-color: #ffffff !important;
  border-color: #d9e1ec !important;
  color: #0f172a !important;
}

html:not(.dark) header input[type="text"]::placeholder {
  color: #94a3b8 !important;
}

html:not(.dark) #theme-toggle {
  background-color: #eef2f7 !important;
  border-color: #d9e1ec !important;
  color: #475569 !important;
}

html:not(.dark) #theme-toggle:hover {
  color: #f25c29 !important;
}

html:not(.dark) .hover\:text-white:hover {
  color: #0f172a !important;
}

html:not(.dark) .bg-secondary,
html:not(.dark) .bg-tertiary {
  background-color: #ffffff !important;
}

html:not(.dark) .border-tertiary,
html:not(.dark) .border-[#333333],
html:not(.dark) .border-[#363636],
html:not(.dark) .border-[#444444] {
  border-color: #d9e1ec !important;
}

html:not(.dark) .bg-secondary .text-white,
html:not(.dark) .bg-tertiary .text-white,
html:not(.dark) .bg-secondary.text-white,
html:not(.dark) .bg-tertiary.text-white,
html:not(.dark) .bg-secondary .text-text-dark,
html:not(.dark) .bg-tertiary .text-text-dark {
  color: #0f172a !important;
}

html:not(.dark) .bg-secondary .text-text-muted-dark,
html:not(.dark) .bg-tertiary .text-text-muted-dark,
html:not(.dark) .bg-secondary .placeholder-text-muted-dark,
html:not(.dark) .bg-tertiary .placeholder-text-muted-dark,
html:not(.dark) .bg-secondary .text-text-muted-light,
html:not(.dark) .bg-tertiary .text-text-muted-light {
  color: #64748b !important;
}

html:not(.dark) .bg-secondary input,
html:not(.dark) .bg-secondary textarea,
html:not(.dark) .bg-secondary select,
html:not(.dark) .bg-tertiary input,
html:not(.dark) .bg-tertiary textarea,
html:not(.dark) .bg-tertiary select {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #d9e1ec !important;
}

html:not(.dark) .bg-secondary input::placeholder,
html:not(.dark) .bg-secondary textarea::placeholder,
html:not(.dark) .bg-secondary select::placeholder,
html:not(.dark) .bg-tertiary input::placeholder,
html:not(.dark) .bg-tertiary textarea::placeholder,
html:not(.dark) .bg-tertiary select::placeholder {
  color: #94a3b8 !important;
}

html:not(.dark) .bg-\[\#252525\],
html:not(.dark) .bg-\[\#343434\],
html:not(.dark) .bg-\[\#3A3A3A\],
html:not(.dark) .bg-tertiary/30,
html:not(.dark) .bg-tertiary/50 {
  background-color: #eef2f7 !important;
}

html:not(.dark) .student-subtab.active,
html:not(.dark) .student-subtab.active:hover {
  background-color: #f25c29 !important;
  border-color: #f25c29 !important;
  color: #ffffff !important;
}

html:not(.dark) .student-subtab,
html:not(.dark) #dashboard-volume-period-toggle button,
html:not(.dark) #dashboard-volume-period-toggle .bg-\[\#3A3A3A\] {
  color: #475569 !important;
}

html:not(.dark) #dashboard-volume-period-toggle {
  background-color: #eef2f7 !important;
}

html:not(.dark) #dashboard-volume-period-toggle .bg-\[\#3A3A3A\] {
  background-color: #ffffff !important;
  box-shadow: inset 0 0 0 1px #d9e1ec;
}

html:not(.dark) .hover\:bg-tertiary:hover,
html:not(.dark) .hover\:bg-\[\#333333\]:hover,
html:not(.dark) .hover\:bg-\[\#2c2c2c\]:hover,
html:not(.dark) .hover\:bg-tertiary\/20:hover {
  background-color: #eef2f7 !important;
}

html:not(.dark) .bg-secondary table,
html:not(.dark) .bg-secondary thead,
html:not(.dark) .bg-secondary tbody,
html:not(.dark) .bg-secondary tr,
html:not(.dark) .bg-secondary td,
html:not(.dark) .bg-secondary th {
  color: #0f172a;
}

html:not(.dark) .bg-secondary .border-tertiary\/50,
html:not(.dark) .bg-secondary .hover\:border-primary\/30:hover,
html:not(.dark) .bg-secondary .hover\:border-primary\/50:hover {
  border-color: #d9e1ec !important;
}

html:not(.dark) .bg-secondary .hover\:bg-red-500\/10:hover,
html:not(.dark) .bg-secondary .hover\:bg-primary\/10:hover,
html:not(.dark) .bg-secondary .bg-primary\/5,
html:not(.dark) .bg-secondary .dark\:bg-primary\/10 {
  background-color: #fff4ef !important;
}

html:not(.dark) .bg-secondary .bg-green-50,
html:not(.dark) .bg-secondary .bg-orange-50,
html:not(.dark) .bg-secondary .bg-red-50,
html:not(.dark) .bg-secondary .bg-slate-100,
html:not(.dark) .bg-secondary .bg-gray-100 {
  color: inherit;
}

html:not(.dark) .modal-overlay {
  background: rgba(15, 23, 42, 0.18);
}

html:not(.dark) #dashboard-volume-period-toggle .dashboard-period-active {
  background-color: #ffffff !important;
  color: #0f172a !important;
  box-shadow: inset 0 0 0 1px #d9e1ec;
}

html:not(.dark) .student-subtab.student-subtab-active,
html:not(.dark) .student-subtab.student-subtab-active:hover {
  background-color: #f25c29 !important;
  border-color: #f25c29 !important;
  color: #ffffff !important;
}

html:not(.dark) .student-subtab:not(.student-subtab-active) {
  color: #64748b !important;
}

html:not(.dark) .student-subtab:not(.student-subtab-active):hover {
  background-color: #eef2f7 !important;
  color: #0f172a !important;
}

html:not(.dark) .bg-\[\#252525\],
html:not(.dark) .bg-\[\#343434\],
html:not(.dark) .bg-\[\#3A3A3A\] {
  background-color: #eef2f7 !important;
}


html.dark .calendar-day-dark {
  background: linear-gradient(180deg, rgba(36,36,36,1), rgba(28,28,28,1));
  border-color: #2d2d2d;
}

html.dark .calendar-day-dark-weekend {
  background: linear-gradient(180deg, rgba(240,90,40,0.07), rgba(34,34,34,0.98));
  border-color: rgba(240,90,40,0.2);
}

html:not(.dark) .calendar-day-light {
  background: #ffffff;
  border-color: #d9e1ec;
}

html:not(.dark) .calendar-day-light-weekend {
  background: linear-gradient(180deg, #fff7f3 0%, #ffffff 100%);
  border-color: #f5b59a;
}

html:not(.dark) #treinos-view > div:first-child {
  background-color: #ffffff !important;
  border-color: #d9e1ec !important;
}

html:not(.dark) #treinos-view > .flex-1,
html:not(.dark) #treinos-view .bg-background-dark {
  background-color: #f4f7fb !important;
}

html:not(.dark) #treinos-view .bg-secondary\/70,
html:not(.dark) #treinos-view .bg-gradient-to-b {
  background: #ffffff !important;
  border-color: #d9e1ec !important;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06) !important;
}

html:not(.dark) #treinos-view .text-white {
  color: #0f172a !important;
}

html:not(.dark) #treinos-view .text-text-muted-dark {
  color: #64748b !important;
}

html:not(.dark) #students-view div:has(> .student-subtab) {
  background-color: #ffffff !important;
  border-color: #d9e1ec !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06) !important;
}

html:not(.dark) #payment-account-status-badge,
html:not(.dark) #payment-automation-overview,
html:not(.dark) #students-payments-view .bg-\[\#1F1F1F\],
html:not(.dark) #students-payments-view .bg-\[\#252525\],
html:not(.dark) #students-payments-view .border-\[\#353535\],
html:not(.dark) #students-payments-view .border-\[\#363636\] {
  background: #ffffff !important;
  border-color: #d9e1ec !important;
  color: #0f172a !important;
}

html:not(.dark) #students-payments-view #payment-automation-overview .text-white,
html:not(.dark) #students-payments-view #payment-account-status-badge .text-white,
html:not(.dark) #students-payments-view .bg-\[\#1F1F1F\] .text-white,
html:not(.dark) #students-payments-view .bg-\[\#252525\] .text-white {
  color: #0f172a !important;
}

html:not(.dark) #students-payments-view #payment-automation-overview .text-text-muted-dark,
html:not(.dark) #students-payments-view .bg-\[\#1F1F1F\] .text-text-muted-dark,
html:not(.dark) #students-payments-view .bg-\[\#252525\] .text-text-muted-dark {
  color: #64748b !important;
}

.activity-report-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
}

.activity-report-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.activity-report-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
}

.activity-report-panel {
  position: relative;
  z-index: 1;
  width: min(1100px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  border-radius: 28px;
  background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
}

.activity-report-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.activity-report-panel-header h2 {
  margin: 4px 0 0;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}

.activity-report-panel-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 700;
}

.activity-report-close {
  border: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  cursor: pointer;
}

.activity-report-body {
  overflow-y: auto;
  padding: 24px;
}

.activity-report-shell {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.activity-report-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(242, 92, 41, 0.22), rgba(15, 23, 42, 0.2));
  border: 1px solid rgba(242, 92, 41, 0.18);
}

.activity-report-hero h2 {
  margin: 6px 0;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
}

.activity-report-hero p,
.activity-report-card-head p,
.activity-report-note {
  margin: 0;
  color: #94a3b8;
}

.activity-report-eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  color: #fdba74;
  font-weight: 700;
}

.activity-report-chip {
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.activity-report-chip-success {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
}

.activity-report-chip-info {
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
}

.activity-report-chip-warning {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
}

.activity-report-chip-danger {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}

.activity-report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.activity-report-card {
  padding: 22px;
  border-radius: 24px;
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.activity-report-card-planned {
  border-color: rgba(59, 130, 246, 0.25);
}

.activity-report-card-done {
  border-color: rgba(16, 185, 129, 0.25);
}

.activity-report-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.activity-report-card-head h3 {
  margin: 0 0 4px;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.activity-report-card-head .material-symbols-outlined {
  color: #f25c29;
}

.activity-report-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.activity-report-stats-compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.activity-report-stat {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.activity-report-stat span {
  display: block;
  margin-bottom: 6px;
  color: #94a3b8;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.activity-report-stat strong {
  color: #fff;
  font-size: 18px;
  line-height: 1.2;
}

.activity-report-note {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  line-height: 1.6;
}

.activity-report-deltas {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.activity-report-delta.positive strong {
  color: #6ee7b7;
}

.activity-report-delta.negative strong {
  color: #fca5a5;
}

.activity-report-actions {
  margin-top: 16px;
}

.activity-report-btn {
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 16px;
  background: #f25c29;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.activity-report-loading,
.activity-report-empty {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  color: #cbd5e1;
}

.activity-report-empty span,
.activity-report-loading span {
  font-size: 36px;
  color: #f25c29;
}

.activity-report-spin {
  animation: activity-report-spin 1.1s linear infinite;
}

@keyframes activity-report-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

html:not(.dark) .activity-report-panel {
  background: linear-gradient(180deg, #ffffff 0%, #eef2f7 100%);
  border-color: #d9e1ec;
}

html:not(.dark) .activity-report-panel-header,
html:not(.dark) .activity-report-card,
html:not(.dark) .activity-report-stat,
html:not(.dark) .activity-report-note {
  border-color: #d9e1ec;
}

html:not(.dark) .activity-report-card,
html:not(.dark) .activity-report-stat,
html:not(.dark) .activity-report-note {
  background: #ffffff;
}

html:not(.dark) .activity-report-panel-header h2,
html:not(.dark) .activity-report-hero h2,
html:not(.dark) .activity-report-card-head h3,
html:not(.dark) .activity-report-stat strong {
  color: #0f172a;
}

html:not(.dark) .activity-report-hero,
html:not(.dark) .activity-report-panel-kicker,
html:not(.dark) .activity-report-eyebrow,
html:not(.dark) .activity-report-hero p,
html:not(.dark) .activity-report-card-head p,
html:not(.dark) .activity-report-note,
html:not(.dark) .activity-report-stat span,
html:not(.dark) .activity-report-close {
  color: #64748b;
}

html:not(.dark) .activity-report-close {
  background: #eef2f7;
}

@media (max-width: 900px) {
  .activity-report-grid,
  .activity-report-deltas,
  .activity-report-stats-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .activity-report-panel {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .activity-report-body,
  .activity-report-panel-header {
    padding: 18px;
  }

  .activity-report-hero,
  .activity-report-grid,
  .activity-report-deltas,
  .activity-report-stats,
  .activity-report-stats-compact {
    grid-template-columns: 1fr;
  }

  .activity-report-hero {
    display: grid;
  }
}

