/* src/themes.css */

/* PP Theme */
html[data-theme='pp-theme'] {
  --clr-brand-1: #8231A7;
  --clr-brand-2: #4B3048;
  --clr-brand-3: #53565A;
  --clr-brand-4: #A7A8A9;
  --clr-border: #D9D9D9;
  --clr-fill-1: #EEEEEE;
  --clr-fill-2: #F5F5F5;
  --clr-highlight: #E4F9FF;

  --font-h1: 'Playfair Display', serif;
  --font-h2: 'Playfair Display', serif;
  --font-h3: 'Montserrat', sans-serif;
  --font-body: 'Montserrat', sans-serif;
}

/* Sarovar Theme */
html[data-theme='sarovar-theme'] {
  --clr-brand-1: #2589ca;
  --clr-brand-2: #eb8223;
  --clr-brand-3: #5888c4;
  --clr-brand-4: #d2863d;
  --clr-border: #D9D9D9;
  --clr-fill-1: #EEEEEE;
  --clr-fill-2: #F5F5F5;
  --clr-highlight: #E4F9FF;

  --font-h1: 'Montserrat', sans-serif;
  --font-h2: 'Montserrat', sans-serif;
  --font-h3: 'Montserrat', sans-serif;
  --font-body: 'Montserrat', sans-serif;
}

/* Sarovar Theme V2 (based on official brand palette & typography) */
html[data-theme='sarovar-theme-v2'] {
  --clr-brand-1: #2b5377; /* Deep blue-gray for buttons, titles */
  --clr-brand-2: #22c3ee; /* Sky blue highlights */
  --clr-brand-3: #85c141; /* Lime green accent (CTAs) */
  --clr-brand-4: #e9c221; /* Yellow secondary */

  --clr-border: #a2bccc;  /* Muted border tone */
  --clr-fill-1: #ecf0f2;  /* Soft gray background */
  --clr-fill-2: #ffffff;  /* White cards */
  --clr-highlight: #d6e0e5; /* Light hover shade */

  --font-h1: 'Poppins', sans-serif;
  --font-h2: 'Poppins', sans-serif;
  --font-h3: 'Poppins', sans-serif;
  --font-body: 'Georgia', serif;
}


/* Global Styles */
body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--clr-fill-2);
  color: var(--clr-brand-3);
}

/* Typography */
h1 {
  font-family: var(--font-h1);
  font-size: 2.5rem;
}

h2 {
  font-family: var(--font-h2);
  font-size: 2rem;
}

h3 {
  font-family: var(--font-h3);
  font-size: 1.5rem;
}

p, span, div {
  font-family: var(--font-body);
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--clr-border);
}

thead tr {
  border-bottom: 2px solid var(--clr-brand-3);
}

th {
  background-color: white;
  color: var(--clr-brand-1);
  text-align: left;
  padding: 0.75rem;
  font-weight: 600;
}


td {
  padding: 0.75rem;
  border-top: 1px solid var(--clr-border);
}

tbody tr:nth-child(even) {
  background-color: var(--clr-fill-1); /* Alternate background */
}

tbody tr:hover {
  background-color: #e0e0e0; /* Slightly darker on hover */
}

tbody tr.selected {
  background-color: var(--clr-highlight); /* Selection state */
}

/* Tabs */
.tab-container {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  border-bottom: 2px solid var(--clr-border);
  margin-bottom: 1rem;
}

.tab {
  position: relative;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  background-color: var(--clr-fill-1);
  color: var(--clr-brand-3);
  border: 1px solid var(--clr-border);
  border-bottom: none;               /* sits “on” the container border */
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  font-weight: 500;
  transition: color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.tab:hover {
  background-color: var(--clr-fill-2);
}

.tab:focus-visible {
  outline: none;
  /* soft focus ring tuned to brand-1 (#2589ca) */
  box-shadow: 0 0 0 3px rgba(37, 137, 202, 0.35);
}

/* Treat .active, aria-selected, and data-active as equivalent */
.tab.active,
.tab[aria-selected="true"],
.tab[data-active="true"] {
  background-color: var(--clr-highlight);
  color: var(--clr-brand-1);
  border-color: var(--clr-brand-1);
}

/* Optional: accent underline to make the active tab obvious */
.tab.active::after,
.tab[aria-selected="true"]::after,
.tab[data-active="true"]::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -0.35rem;  /* hangs into the container border area */
  height: 3px;
  background: var(--clr-brand-2);
  border-radius: 999px;
}


/* Dropdowns */
select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--clr-border);
  border-radius: 6px;
  background-color: var(--clr-fill-2);
  color: var(--clr-brand-3);
  font-family: var(--font-body);
  font-size: 0.95rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: border-color 0.2s, box-shadow 0.2s;
}

select:focus {
  outline: none;
  border-color: var(--clr-brand-1);
  box-shadow: 0 0 0 2px var(--clr-highlight);
}


/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--clr-fill-2);
}

::-webkit-scrollbar-thumb {
  background-color: var(--clr-brand-2);
  border-radius: 5px;
  border: 2px solid var(--clr-fill-2);
}

/* Buttons */
button {
  padding: 0.5rem 1.25rem;
  background-color: var(--clr-brand-1);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  transition: background-color 0.2s ease-in-out;
}

button:hover {
  background-color: var(--clr-brand-2);
}

button:disabled {
  background-color: var(--clr-border);
  cursor: not-allowed;
}

/* Card Component */
.card {
  background-color: white;
  border: 1px solid var(--clr-border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  margin-bottom: 1rem;
}

/* Input/Textarea */
input, textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--clr-border);
  border-radius: 4px;
  font-family: var(--font-body);
  background-color: white;
}

/* Tooltip */
.tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
}

.tooltip .tooltiptext {
  visibility: hidden;
  background-color: var(--clr-brand-3);
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 0.5rem;
  position: absolute;
  z-index: 1;
  bottom: 125%; /* Position above */
  left: 50%;
  margin-left: -60px;
  width: 120px;
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* Modal (optional styling) */
.modal {
  background-color: white;
  border: 1px solid var(--clr-border);
  padding: 2rem;
  border-radius: 10px;
  max-width: 500px;
  margin: 2rem auto;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.dashboard-wrapper {
  padding: 1rem;
}

.kpi-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.kpi-card {
  flex: 1;
  padding: 1rem;
  border: 1px solid var(--clr-border);
  border-radius: 12px;
  background-color: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.kpi-card h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.kpi-card p {
  font-size: 1.25rem;
  font-weight: bold;
}

.table-scroll {
  max-height: 300px;
  overflow-y: auto;
}

.dropdown-block {
  display: block;
  margin: 1rem 0;
}

.chart-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: stretch;
}

.chart-box {
  flex: 1 1 45%;
  min-width: 300px;
  min-height: 350px;
  padding: 1rem;
  box-sizing: border-box;
  background-color: white;
  border-radius: 12px;
  border: 1px solid var(--clr-border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* Theming Variables remain unchanged */

/* Form Controls: Radio Buttons, Checkboxes, Range Sliders, Spinners */
input[type="radio"],
input[type="checkbox"] {
  accent-color: var(--clr-brand-1);
  cursor: pointer;
  margin-right: 0.5rem;
}

.radio-group,
.checkbox-group {
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--clr-fill-1);
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--clr-brand-1);
  cursor: pointer;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--clr-brand-1);
  cursor: pointer;
}

input[type="number"] {
  width: 100px;
  padding: 0.5rem;
  border: 1px solid var(--clr-border);
  border-radius: 4px;
  font-family: var(--font-body);
  background-color: white;
}

/* ...existing styles for body, table, buttons, tabs, charts, etc. remain unchanged... */
