/* ============================================
   REPORT LOUNGE - FANCY WHITE THEME
   ============================================ */

:root {
  /* Colors */
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.15);

  --accent-teal: #14b8a6;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --green-500: #10b981;
  --green-bg: #d1fae5;
  --green-border: #6ee7b7;
  --orange-500: #f97316;
  --orange-bg: #ffedd5;
  --orange-border: #fdba74;
  --blue-500: #3b82f6;
  --blue-bg: #dbeafe;
  --blue-border: #93c5fd;

  --bg: #f5f7fa;
  --bg-subtle: #f8fafc;
  --bg-card: #ffffff;
  --border: #e5e7eb;
  --border-light: #f3f4f6;

  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-tertiary: #9ca3af;
  --text-muted: #d1d5db;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  --gradient-teal: linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%);
  --gradient-header: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 6px 16px rgba(0, 0, 0, 0.04);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* Transitions */
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
}

/* Subtle background pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ============================================
   APP CONTAINER
   ============================================ */
.app {
  position: relative;
  z-index: 1;
  width: min(1100px, 96vw);
  margin: 0 auto;
  padding: 24px 0 48px;
}

/* ============================================
   HEADER
   ============================================ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  margin-bottom: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  transition: var(--transition);
}

.logo:hover {
  transform: scale(1.05) rotate(-2deg);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.logo svg {
  width: 22px;
  height: 22px;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.header-stats {
  display: flex;
  gap: 2px;
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  padding: 4px;
}

.header-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  transition: var(--transition);
  cursor: default;
}

.header-stat:hover {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.header-stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.header-stat-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ============================================
   REPORTS PANEL
   ============================================ */
.reports-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
}

.reports-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  padding: 1px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), transparent, rgba(139, 92, 246, 0.1));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Filters */
.filters-bar {
  display: flex;
  gap: 12px;
  padding: 18px;
  background: linear-gradient(180deg, var(--bg-subtle) 0%, var(--bg-card) 100%);
  border-bottom: 1px solid var(--border-light);
  position: relative;
  z-index: 1;
}

.search-wrapper {
  position: relative;
  flex: 2;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-tertiary);
  pointer-events: none;
  transition: var(--transition);
}

.search-input:focus + .search-icon,
.search-wrapper:focus-within .search-icon {
  color: var(--primary);
}

.search-input {
  width: 100%;
  padding: 12px 14px 12px 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: var(--transition);
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.filter-group {
  display: flex;
  gap: 10px;
  flex: 1;
}

.filter-select {
  flex: 1;
  padding: 12px 36px 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.filter-select:hover {
  border-color: var(--text-tertiary);
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.filter-select option {
  background: var(--bg-card);
  padding: 8px;
}

/* Table */
.reports-table-wrapper {
  max-height: 600px;
  overflow: auto;
  position: relative;
  z-index: 1;
}

.reports-table-wrapper::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.reports-table-wrapper::-webkit-scrollbar-track {
  background: var(--bg-subtle);
}

.reports-table-wrapper::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
  border: 2px solid var(--bg-subtle);
}

.reports-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

.table-header {
  display: grid;
  grid-template-columns: minmax(260px, 2.5fr) 1.2fr 1fr 0.8fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  background: linear-gradient(180deg, var(--bg-subtle) 0%, rgba(248, 250, 252, 0.8) 100%);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(8px);
}

.th {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

/* Table Row */
.row {
  display: grid;
  grid-template-columns: minmax(260px, 2.5fr) 1.2fr 1fr 0.8fr auto;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
  position: relative;
}

.row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: var(--transition);
}

.row:last-child {
  border-bottom: none;
}

.row:hover {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.03) 0%, transparent 50%);
}

.row:hover::before {
  opacity: 1;
}

.name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  overflow-wrap: anywhere;
  display: flex;
  align-items: center;
  gap: 10px;
}

.name::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--gradient-primary);
  border-radius: 3px;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

/* Category Pills */
.category-pill {
  display: inline-flex;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid;
}

.category-pill.weekly {
  background: var(--green-bg);
  color: var(--green-500);
  border-color: var(--green-border);
}

.category-pill.screenshot {
  background: var(--orange-bg);
  color: var(--orange-500);
  border-color: var(--orange-border);
}

.category-pill.monthly {
  background: #fef3c7;
  color: #d97706;
  border-color: #fcd34d;
}

.category-pill.other {
  background: var(--blue-bg);
  color: var(--blue-500);
  border-color: var(--blue-border);
}

/* Mono Text */
.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Download Button */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
  position: relative;
  overflow: hidden;
}

.button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
  opacity: 0;
  transition: var(--transition);
}

.button::after {
  content: '↓';
  font-size: 0.9em;
  margin-left: 2px;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.button:hover::before {
  opacity: 1;
}

.button:active {
  transform: translateY(0);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-icon {
  width: 56px;
  height: 56px;
  color: var(--text-muted);
  margin-bottom: 20px;
  opacity: 0.6;
}

.empty-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-description {
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

.hidden {
  display: none !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 16px;
    padding: 16px 20px;
  }

  .header::before {
    height: 2px;
  }

  .header-stats {
    width: 100%;
    justify-content: center;
  }

  .header-stat {
    padding: 8px 16px;
  }

  .filters-bar {
    flex-direction: column;
    padding: 14px;
  }

  .filter-group {
    flex-direction: column;
    gap: 8px;
  }

  .table-header {
    display: none;
  }

  .row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px 16px;
  }

  .row::before {
    width: 100%;
    height: 2px;
    top: 0;
    bottom: auto;
    opacity: 0.5;
  }

  .button {
    width: 100%;
    margin-top: 4px;
  }
}

/* Focus States */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

::selection {
  background: rgba(99, 102, 241, 0.2);
}

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

.row {
  animation: fadeIn 0.3s ease forwards;
}

.row:nth-child(1) { animation-delay: 0ms; }
.row:nth-child(2) { animation-delay: 30ms; }
.row:nth-child(3) { animation-delay: 60ms; }
.row:nth-child(4) { animation-delay: 90ms; }
.row:nth-child(5) { animation-delay: 120ms; }
