/* Modern Premium Design System for 2026 Tamil Calendar Rasi Analytics */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-card: rgba(22, 30, 49, 0.65);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.15);
  
  --accent-color: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.35);
  --accent-secondary: #8b5cf6;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --color-pos: #10b981;
  --color-pos-bg: rgba(16, 185, 129, 0.15);
  --color-neutral: #f59e0b;
  --color-neutral-bg: rgba(245, 158, 11, 0.15);
  --color-neg: #ef4444;
  --color-neg-bg: rgba(239, 68, 68, 0.15);
  
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  
  --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 1px 1px 0 rgba(255, 255, 255, 0.05) inset;
}

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

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.1) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 0%, rgba(16, 185, 129, 0.03) 0px, transparent 50%);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* Header & Controls */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.branding h1 {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, #f8fafc 30%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.025em;
}

.branding p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.global-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: rgba(30, 41, 59, 0.4);
  backdrop-filter: blur(12px);
  padding: 0.6rem 1.2rem;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-premium);
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: 700;
}

/* Redesigned Date Picker Widget */
.date-picker-widget {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.widget-nav-btn {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.widget-nav-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-color);
  box-shadow: 0 0 10px var(--border-glow);
}

.date-input-container {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.25rem 0.5rem 0.25rem 0.75rem;
  gap: 0.5rem;
  position: relative;
  transition: var(--transition-smooth);
}

.date-input-container:focus-within {
  border-color: var(--accent-color);
  box-shadow: 0 0 10px var(--border-glow);
}

.widget-cal-icon {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.date-input-container input[type="date"] {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  padding: 0.35rem 0;
  width: 130px;
}

.date-input-container input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(1) opacity(0.6);
}

.btn-today-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-today-pill:hover {
  background: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Redesigned Sliding Segmented Control */
.segmented-control-container {
  display: flex;
  align-items: center;
}

.segmented-control {
  position: relative;
  display: flex;
  background: rgba(15, 23, 42, 0.7);
  border-radius: 10px;
  padding: 3px;
  border: 1px solid var(--border-color);
  width: 250px;
  height: 38px;
}

.segment-slider {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  background: var(--accent-color);
  border-radius: 7px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
  z-index: 1;
}

.segmented-control[data-active="0"] .segment-slider {
  transform: translateX(0);
  width: calc(25% - 4px);
}

.segmented-control[data-active="1"] .segment-slider {
  transform: translateX(calc(100% + 4px));
  width: calc(25% - 4px);
}

.segmented-control[data-active="2"] .segment-slider {
  transform: translateX(calc(200% + 8px));
  width: calc(25% - 4px);
}

.segmented-control[data-active="3"] .segment-slider {
  transform: translateX(calc(300% + 12px));
  width: calc(25% - 4px);
}

.segment-btn {
  position: relative;
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 2;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.segment-btn.active {
  color: #fff;
}

/* Dashboard Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar, .main-panel {
    min-width: 0;
    width: 100%;
  }
}

/* Sidebar: Rasi List */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-header {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Redesigned Rasi Grid Selector */
.rasi-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  max-height: 720px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.rasi-card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.75rem 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-bounce);
  box-shadow: var(--shadow-premium);
  gap: 0.35rem;
  position: relative;
}

.rasi-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-3px) scale(1.02);
  border-color: rgba(99, 102, 241, 0.25);
}

.rasi-card.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.12) 100%);
  border-color: var(--accent-color);
  box-shadow: 0 0 15px var(--border-glow);
}

/* Dynamic Score Border Glow for Active Rasi Cards */
.rasi-card.score-positive {
  border-color: rgba(16, 185, 129, 0.25);
}
.rasi-card.score-positive.active {
  border-color: var(--color-pos);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.25);
}

.rasi-card.score-negative {
  border-color: rgba(239, 68, 68, 0.25);
}
.rasi-card.score-negative.active {
  border-color: var(--color-neg);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.25);
}

.rasi-card.score-neutral {
  border-color: rgba(245, 158, 11, 0.25);
}
.rasi-card.score-neutral.active {
  border-color: var(--color-neutral);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.25);
}

.rasi-info-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.rasi-emoji {
  font-size: 1.4rem;
  background: rgba(255, 255, 255, 0.03);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition-smooth);
}

.rasi-card:hover .rasi-emoji {
  background: rgba(255, 255, 255, 0.08);
}

.rasi-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rasi-name-ta {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.2;
}

.rasi-name-en {
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.2;
}

.rasi-prediction {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.rasi-word {
  font-size: 0.75rem;
  font-weight: 600;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.8;
  display: none; /* Hide verbose words to keep grid clean, show only score badge */
}

.score-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.1rem 0.5rem;
  border-radius: 20px;
  display: inline-block;
  line-height: 1.2;
}

.score-badge.positive {
  background: var(--color-pos-bg);
  color: var(--color-pos);
}

.score-badge.neutral {
  background: var(--color-neutral-bg);
  color: var(--color-neutral);
}

.score-badge.negative {
  background: var(--color-neg-bg);
  color: var(--color-neg);
}

/* Main Panel */
.main-panel {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Glassmorphism Card Container */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: var(--shadow-premium);
}

/* Overview Panel */
.today-summary {
  display: grid;
  grid-template-columns: 1.2fr 1.8fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .today-summary {
    grid-template-columns: 1fr;
  }
}

.rasi-detail-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.rasi-detail-title h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
}

.prediction-box {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 200px;
}

.prediction-large-word {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.prediction-translation {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
}

.score-display-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.95rem;
}

.score-display-pill.positive {
  background: var(--color-pos-bg);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--color-pos);
}

.score-display-pill.neutral {
  background: var(--color-neutral-bg);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--color-neutral);
}

.score-display-pill.negative {
  background: var(--color-neg-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--color-neg);
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 580px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

.metric-card {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.metric-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Charts Panel */
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.chart-header h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 350px;
}

/* Calendar Month View styling */
.calendar-view-header {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calendar-view-header h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
}

.calendar-month-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-color);
}

.calendar-grid-container {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  text-align: center;
}

.calendar-day-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calendar-cell {
  aspect-ratio: 1.2;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: var(--transition-bounce);
  border: 1px solid transparent;
}

.calendar-cell:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 10;
  border-color: rgba(255, 255, 255, 0.2);
}

.calendar-cell.empty {
  cursor: default;
  background: transparent !important;
  opacity: 0.15;
}

.calendar-cell.empty:hover {
  transform: none;
  box-shadow: none;
}

.calendar-cell.active-focus {
  border: 2px solid var(--text-primary);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.calendar-cell-date {
  align-self: flex-start;
}

.calendar-cell-word {
  align-self: center;
  font-size: 0.65rem;
  font-weight: 500;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.85;
}

/* Color scales for calendar cells */
.cell-pos-4 { background-color: rgba(16, 185, 129, 0.8); color: #fff; }
.cell-pos-3 { background-color: rgba(16, 185, 129, 0.6); color: #fff; }
.cell-pos-2 { background-color: rgba(52, 211, 153, 0.55); color: #fff; }
.cell-pos-1 { background-color: rgba(110, 231, 183, 0.45); color: #fff; }
.cell-neu-0 { background-color: rgba(245, 158, 11, 0.35); color: #fff; }
.cell-neg-1 { background-color: rgba(251, 113, 133, 0.4); color: #fff; }
.cell-neg-2 { background-color: rgba(244, 63, 94, 0.6); color: #fff; }
.cell-neg-3 { background-color: rgba(225, 29, 72, 0.8); color: #fff; }

/* Compare Rasis section */
.compare-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.compare-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.compare-select {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-family: var(--font-body);
  outline: none;
  cursor: pointer;
  min-width: 200px;
}

.compare-select:focus {
  border-color: var(--accent-color);
}

/* Mobile Responsive Styling */
@media (max-width: 768px) {
  .app-container {
    padding: 1rem 0.75rem;
  }

  header {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
  }

  .branding {
    text-align: center;
  }

  .branding h1 {
    font-size: 1.8rem;
  }

  .global-controls {
    flex-direction: column;
    align-items: stretch;
    padding: 0.85rem;
    gap: 1.25rem;
    border-radius: 12px;
  }

  .control-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .control-group label {
    text-align: center;
  }

  /* Date Picker Widget Mobile */
  .date-picker-widget {
    width: 100%;
    justify-content: center;
  }
  
  .date-input-container {
    flex: 1;
    justify-content: space-between;
  }

  .date-input-container input[type="date"] {
    flex: 1;
    text-align: center;
  }

  /* Segmented Control Mobile */
  .segmented-control-container {
    width: 100%;
    justify-content: center;
  }

  .segmented-control {
    width: 100%;
  }

  /* Rasi 4-Column Grid for Mobile */
  .rasi-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
    max-height: none;
    padding-bottom: 0;
  }

  .rasi-card {
    padding: 0.5rem 0.2rem;
    border-radius: 10px;
    gap: 0.15rem;
  }

  .rasi-card:hover {
    transform: none; /* Disable scale/translate hover animations on mobile touch */
  }

  .rasi-info-wrapper {
    flex-direction: column;
    gap: 0.15rem;
    align-items: center;
  }

  .rasi-emoji {
    width: 32px;
    height: 32px;
    font-size: 1.15rem;
    border-radius: 50%;
  }

  .rasi-meta {
    align-items: center;
  }

  .rasi-name-ta {
    font-size: 0.75rem;
  }

  .rasi-name-en {
    font-size: 0.65rem;
  }

  .rasi-prediction {
    align-items: center;
    text-align: center;
    gap: 0.15rem;
  }

  .score-badge {
    font-size: 0.65rem;
    padding: 0.05rem 0.35rem;
  }

  /* Today Summary Card on Mobile */
  .today-summary {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.25rem;
  }

  .prediction-box {
    min-height: 150px;
    padding: 1rem;
  }

  .prediction-large-word {
    font-size: 1.8rem;
  }

  .prediction-translation {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
  }

  .metrics-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .metric-card {
    padding: 0.75rem 0.4rem;
    text-align: center;
    border-radius: 8px;
  }

  .metric-label {
    font-size: 0.65rem;
  }

  .metric-value {
    font-size: 1.15rem;
  }

  .metric-desc {
    font-size: 0.6rem;
  }

  .glass-panel {
    padding: 1.25rem;
    border-radius: 12px;
  }

  .chart-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .chart-header h3 {
    text-align: center;
  }

  .chart-header p {
    text-align: center;
  }

  .chart-wrapper {
    height: 250px;
  }

  .calendar-view-header {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
  }

  .calendar-grid-container {
    gap: 0.25rem;
  }

  .calendar-day-label {
    font-size: 0.7rem;
    padding: 0.25rem 0;
  }

  .calendar-cell {
    aspect-ratio: 1;
    padding: 0.25rem 0.1rem;
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
  }

  .calendar-cell-date {
    align-self: center;
    font-weight: 700;
    margin-top: 0.05rem;
  }

  .calendar-cell-word {
    display: block;
    font-size: 0.52rem;
    font-weight: 600;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    opacity: 0.95;
    margin-bottom: 0.05rem;
  }
}

@media (max-width: 480px) {
  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

