@import "tailwindcss";

@source "../components/**/*.{ts,tsx}";
@source "./**/*.{ts,tsx}";

/* OneDash Premium Light Theme */
:root {
  /* Clean, bright backgrounds */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fc;
  --bg-card: #ffffff;
  --bg-sidebar: #fafbfd;
  --bg-hover: #f1f3f9;
  --bg-skeleton: #f1f3f9;

  /* Text colors with hierarchy */
  --text-primary: #1a1d26;
  --text-secondary: #5a6178;
  --text-muted: #8b92a8;
  --text-disabled: #d1d5db;

  /* OneScribe Blue accent colors */
  --accent-gold: #007BFC;
  --accent-gold-light: #3b9bff;
  --accent-gold-dark: #0069d9;
  --accent-copper: #0056b3;

  /* Status colors */
  --status-success: #10b981;
  --status-warning: #f59e0b;
  --status-danger: #ef4444;
  --status-info: #3b82f6;

  /* Short aliases for status colors */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  /* Accent hover states */
  --accent-gold-hover: #0069d9;

  /* Chart colors */
  --chart-1: #007BFC;
  --chart-2: #0056b3;
  --chart-3: #10b981;
  --chart-4: #3b82f6;
  --chart-5: #8b5cf6;
  --chart-6: #ec4899;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);

  /* Borders */
  --border-color: #e5e7eb;
  --border-light: #f1f3f9;
}

/* OneDash Premium Dark Theme */
[data-theme="dark"] {
  /* Deep, rich backgrounds */
  --bg-primary: #13151a;
  --bg-secondary: #0f1015;
  --bg-card: #1a1d24;
  --bg-sidebar: #16181e;
  --bg-hover: #22252e;
  --bg-skeleton: #2d3139;

  /* Light text for dark mode */
  --text-primary: #f8f9fc;
  --text-secondary: #a8afc4;
  --text-muted: #6b7280;
  --text-disabled: #4b5563;

  /* OneScribe Blue accents for dark mode */
  --accent-gold: #60a5fa;
  --accent-gold-light: #93c5fd;
  --accent-gold-dark: #3b82f6;
  --accent-copper: #2563eb;

  /* Status colors - slightly adjusted for dark mode */
  --status-success: #22c997;
  --status-warning: #f5a623;
  --status-danger: #f56565;
  --status-info: #4da3ff;

  /* Short aliases for status colors */
  --success: #22c997;
  --warning: #f5a623;
  --danger: #f56565;
  --info: #4da3ff;

  /* Accent hover states */
  --accent-gold-hover: #93c5fd;

  /* Chart colors - brighter for dark mode */
  --chart-1: #60a5fa;
  --chart-2: #3b82f6;
  --chart-3: #22c997;
  --chart-4: #4da3ff;
  --chart-5: #a78bfa;
  --chart-6: #f472b6;

  /* Shadows - subtle glows for dark mode */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);

  /* Borders */
  --border-color: #2d3139;
  --border-light: #22252e;
}

@theme inline {
  --color-background: #ffffff;
  --color-foreground: #1a1d26;
  --font-sans: "Montserrat", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 500;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Elegant scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: #d1d5e0;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #b8bece;
}

/* Shimmer animation */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.shimmer {
  background: linear-gradient(
    90deg,
    #f1f3f9 25%,
    #e8ebf2 50%,
    #f1f3f9 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite ease-in-out;
}

[data-theme="dark"] .shimmer {
  background: linear-gradient(
    90deg,
    #22252e 25%,
    #2d3139 50%,
    #22252e 75%
  );
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #3d424d;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #4d535f;
}

/* Pulse animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Selection styling */
::selection {
  background: var(--accent-gold);
  color: white;
}

/* Focus styles - Enhanced for accessibility */
*:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

/* Button and link focus enhancement */
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Input focus styles */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 0;
  border-color: var(--accent-gold);
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .shimmer {
    animation: none;
    background: var(--bg-skeleton);
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-color: #1a1d26;
    --text-secondary: #4a4e5c;
  }

  [data-theme="dark"] {
    --border-color: #e5e7eb;
    --text-secondary: #d1d5db;
  }
}

/* Number formatting */
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Screen reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ========================================
   Revenue Page - Plan Breakdown Styles
   ======================================== */
.plan-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-breakdown-item {
  padding: 16px;
  background-color: var(--bg-secondary);
  border-radius: 12px;
}

.plan-breakdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}

.plan-breakdown-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.plan-breakdown-badge {
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
}

.plan-breakdown-subs {
  color: var(--text-secondary);
  font-size: 13px;
}

.plan-breakdown-revenue {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 16px;
}

.plan-breakdown-bar-bg {
  width: 100%;
  background-color: var(--bg-skeleton);
  border-radius: 4px;
  height: 6px;
}

.plan-breakdown-bar {
  height: 6px;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.plan-breakdown-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 639px) {
  .plan-breakdown-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .plan-breakdown-revenue {
    font-size: 15px;
  }
}

/* ========================================
   Revenue Page - Transactions List Styles
   ======================================== */
.transactions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.transaction-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background-color: var(--bg-secondary);
  border-radius: 10px;
}

.transaction-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background-color: rgba(0,123,252,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #007BFC;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.transaction-info {
  flex: 1;
  min-width: 0;
}

.transaction-name {
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transaction-email {
  color: var(--text-muted);
  font-size: 12px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transaction-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.transaction-plan {
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
}

.transaction-amount {
  text-align: right;
}

.transaction-price {
  font-weight: 700;
  color: var(--success);
  margin: 0;
  font-size: 14px;
}

.transaction-date {
  color: var(--text-muted);
  font-size: 11px;
  margin: 0;
}

@media (max-width: 639px) {
  .transaction-item {
    flex-wrap: wrap;
    gap: 10px;
  }

  .transaction-info {
    flex: 1;
    min-width: calc(100% - 52px);
  }

  .transaction-meta {
    width: 100%;
    justify-content: space-between;
    padding-left: 52px;
  }
}

/* ========================================
   Engagement Page - Power Users List Styles
   ======================================== */
.power-users-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.power-user-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background-color: var(--bg-secondary);
  border-radius: 12px;
}

.power-user-rank {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.power-user-info {
  flex: 1;
  min-width: 0;
}

.power-user-name {
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  font-size: 14px;
}

.power-user-email {
  color: var(--text-muted);
  font-size: 12px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.power-user-active {
  color: var(--text-muted);
  font-size: 12px;
  margin: 0;
  display: none;
}

.power-user-active span {
  font-weight: 600;
  color: var(--text-primary);
}

.power-user-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.power-user-stats {
  text-align: right;
}

.power-user-minutes {
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  font-size: 14px;
}

.power-user-transcriptions {
  color: var(--text-muted);
  font-size: 12px;
  margin: 0;
}

.power-user-plan {
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
}

@media (max-width: 639px) {
  .power-user-item {
    flex-wrap: wrap;
    gap: 10px;
  }

  .power-user-info {
    flex: 1;
    min-width: calc(100% - 48px);
  }

  .power-user-active {
    display: block;
  }

  .power-user-meta {
    width: 100%;
    justify-content: space-between;
    padding-left: 48px;
  }
}
