:root {
  --primary: #ffc107;
  /* Gold Yellow */
  --primary-dark: #f2a900;
  --secondary: #2563eb;
  --bg-color: transparent;
  --surface: rgba(20, 20, 20, 0.4);
  --text-main: #f8f9fa;
  --text-sub: #a1a1aa;
  --border: rgba(255, 193, 7, 0.15);
  /* Gold border */
  --blue: #3b82f6;
  --yellow: #facc15;
  --red: #ef4444;
  --green: #22c55e;
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  /* Stronger shadow */
  --glass-blur: blur(20px);
}

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

body {
  font-family: 'Montserrat', sans-serif;
  background-color: #050505;
  /* Deep Charcoal */
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

#antigravity-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Header & Nav */
.app-header {
  background-color: rgba(20, 20, 20, 0.7);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.logo {
  font-size: 1.3rem;
  padding: 15px 20px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 1px;
}

.logo .icon-inline {
  color: var(--primary);
  filter: drop-shadow(0 0 8px rgba(255, 193, 7, 0.5));
}

.nav-bar {
  display: flex;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-btn {
  flex: 1;
  padding: 12px 0;
  color: var(--text-sub);
  font-weight: 500;
  font-size: 0.95rem;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.nav-btn.active {
  color: var(--primary);
  font-weight: 800;
  border-bottom: 3px solid var(--primary);
  background: rgba(255, 193, 7, 0.05);
  box-shadow: inset 0 -4px 10px rgba(255, 193, 7, 0.1);
}

/* Main Content */
.app-main {
  max-width: 800px;
  margin: 0 auto;
  min-height: calc(100vh - 120px);
}

.page-view {
  display: none;
  padding: 20px;
  animation: fadeIn 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

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

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

/* Home View Elements */
.hero-section {
  background: linear-gradient(145deg, rgba(20, 20, 20, 0.8), rgba(10, 10, 10, 0.9));
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 35px 20px;
  color: var(--text-main);
  text-align: center;
  margin-bottom: 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50px;
  left: 50%;
  width: 200px;
  height: 100px;
  background: var(--primary);
  filter: blur(80px);
  transform: translateX(-50%);
  opacity: 0.15;
}

.hero-section h2 {
  font-size: 1.5rem;
  line-height: 1.4;
  margin-bottom: 15px;
  font-weight: 700;
}

.highlight {
  color: var(--primary);
  text-shadow: 0 0 15px rgba(255, 193, 7, 0.4);
  font-weight: 900;
}

.hero-sub {
  font-size: 0.95rem;
  color: var(--text-sub);
  margin-bottom: 25px;
}

.btn-primary {
  background: linear-gradient(135deg, #f2a900, #ffc107);
  color: #000;
  font-weight: 800;
  padding: 14px 28px;
  border-radius: 50px;
  font-size: 1.05rem;
  box-shadow: 0 5px 20px rgba(242, 169, 0, 0.4);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  letter-spacing: 0.5px;
}

.btn-primary.PWA-btn {
  width: 100%;
  max-width: 320px;
}

.btn-primary:active,
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(242, 169, 0, 0.6);
}

.hidden {
  display: none !important;
}

/* Quick Access Cards */
.quick-access {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  margin-bottom: 35px;
}

@media (min-width: 600px) {
  .quick-access {
    grid-template-columns: repeat(3, 1fr);
  }
}

.qa-card {
  background: rgba(20, 20, 20, 0.6);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 20px;
  padding: 25px 15px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

.qa-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(255, 193, 7, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
}

.qa-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 193, 7, 0.3);
}

.qa-card:hover::after {
  opacity: 1;
}

.qa-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  color: var(--primary);
  filter: drop-shadow(0 0 5px rgba(255, 193, 7, 0.3));
  position: relative;
  z-index: 1;
}

.qa-card h3 {
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 8px;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.qa-card p {
  font-size: 0.85rem;
  color: var(--text-sub);
  position: relative;
  z-index: 1;
}

/* Top Performers */
.top-performers-section {
  padding: 25px 20px;
  background: rgba(20, 20, 20, 0.6);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
}

.section-title {
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: var(--primary);
  text-shadow: 0 0 10px rgba(255, 193, 7, 0.2);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-desc {
  font-size: 0.95rem;
  color: var(--text-sub);
  margin-bottom: 20px;
}

.performer-list {
  list-style: none;
}

.performer-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.3s;
  border-radius: 8px;
}

.performer-item:hover {
  background: rgba(255, 193, 7, 0.03);
}

.performer-item:last-child {
  border-bottom: none;
}

.per-info strong {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.per-info span {
  font-size: 0.85rem;
  color: var(--text-sub);
}

.per-stat {
  background: rgba(255, 193, 7, 0.1);
  color: var(--primary);
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 193, 7, 0.2);
}

/* General View Styles */
.view-title {
  font-size: 1.5rem;
  color: #fff;
  margin-bottom: 10px;
  font-weight: 800;
}

.view-title span {
  font-size: 1rem;
  color: var(--primary);
  font-weight: 500;
}

.filter-bar {
  margin-bottom: 15px;
  display: flex;
  justify-content: flex-end;
}

.select-box {
  background: rgba(20, 20, 20, 0.8);
  color: #fff;
  border: 1px solid var(--border);
  padding: 8px 15px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
}

/* Table Styles */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  background: rgba(20, 20, 20, 0.6);
  backdrop-filter: var(--glass-blur);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 650px;
  text-align: center;
}

.data-table th,
.data-table td {
  padding: 14px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.95rem;
}

.data-table th {
  background-color: rgba(0, 0, 0, 0.4);
  color: var(--primary);
  font-weight: 800;
  white-space: nowrap;
}

.data-table tbody tr {
  transition: all 0.3s ease;
}

.data-table tbody tr:hover {
  background-color: rgba(255, 193, 7, 0.05);
}

.score-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 800;
}

.score-good {
  background-color: rgba(255, 193, 7, 0.15);
  color: var(--primary);
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.score-warn {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ccc;
}

.score-bad {
  background-color: rgba(234, 67, 53, 0.15);
  color: var(--red);
  border: 1px solid rgba(234, 67, 53, 0.3);
}

.table-legend {
  font-size: 0.85rem;
  color: var(--text-sub);
  background: rgba(20, 20, 20, 0.6);
  backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 15px 20px;
  border-radius: 16px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.legend-item {
  margin-right: 15px;
  display: inline-flex;
  align-items: center;
  color: #fff;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.dot.blue {
  background-color: var(--primary);
  box-shadow: 0 0 5px var(--primary);
}

.dot.yellow {
  background-color: #888;
}

.dot.red {
  background-color: var(--red);
}

.legend-note {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  color: var(--text-sub);
}

/* Chart Area */
.chart-wrapper {
  width: 100%;
  height: 400px;
  position: relative;
  background: rgba(20, 20, 20, 0.6) !important;
  border: 1px solid var(--border) !important;
  color: #fff;
}

.chart-wrapper h3 {
  color: #fff !important;
}

@media (min-width: 600px) {
  .chart-wrapper {
    height: 500px;
  }
}

/* Calculator Form */
.calc-form {
  background: rgba(20, 20, 20, 0.6);
  backdrop-filter: var(--glass-blur);
  padding: 25px 20px;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  margin-bottom: 25px;
  border: 1px solid var(--border);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
  font-size: 0.95rem;
}

.input-box {
  width: 100%;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

.input-box:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(255, 193, 7, 0.2);
  background: rgba(0, 0, 0, 0.5);
}

.form-row {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.form-group.half {
  flex: 1;
  min-width: 140px;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 0;
}

.label-danger {
  color: #ccc !important;
}

.label-success {
  color: var(--primary) !important;
  text-shadow: 0 0 5px rgba(255, 193, 7, 0.3);
}

.input-info {
  font-size: 0.9rem;
  color: var(--text-sub);
  margin-top: 8px;
}

.input-info span {
  color: #fff;
  font-weight: 700;
}

.full-width {
  width: 100%;
  margin-top: 15px;
}

/* Chart Results */
.result-area {
  background: linear-gradient(145deg, rgba(20, 20, 20, 0.8), rgba(10, 10, 10, 0.9));
  backdrop-filter: var(--glass-blur);
  padding: 30px 20px;
  border-radius: 24px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--primary);
}

.result-title {
  text-align: center;
  margin-bottom: 30px;
  color: #fff;
  font-weight: 800;
  font-size: 1.3rem;
}

.chart-container {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  height: 250px;
  padding-bottom: 30px;
  margin-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.chart-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 40%;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}

.bar-track {
  width: 50px;
  height: 80%;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px 8px 0 0;
  position: relative;
  display: flex;
  align-items: flex-end;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.bar {
  width: 100%;
  border-radius: 8px 8px 0 0;
  transition: height 1.2s cubic-bezier(0.1, 0.7, 0.1, 1);
}

.fill-red {
  background: linear-gradient(to top, #444, #777);
}

.fill-blue {
  background: linear-gradient(to top, #f2a900, #ffc107);
  box-shadow: 0 0 15px rgba(255, 193, 7, 0.4);
}

.bar-value {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 800;
  font-size: 0.95rem;
  white-space: nowrap;
  color: #fff;
}

.bar-label {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 35px;
  color: var(--text-sub);
}

.saving-card {
  background: rgba(255, 193, 7, 0.05);
  text-align: center;
  padding: 25px;
  border-radius: 20px;
  border: 1px dashed var(--primary);
}

.saving-card h4 {
  color: #fff;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.saving-value {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 5px;
  text-shadow: 0 0 20px rgba(255, 193, 7, 0.4);
}

.saving-percent {
  font-size: 1rem;
  color: var(--text-sub);
}

/* Video Gallery */
.video-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

@media (min-width: 600px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.video-card {
  background: rgba(20, 20, 20, 0.6);
  backdrop-filter: var(--glass-blur);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: all 0.4s ease;
}

.video-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
  border-color: var(--border);
}

.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  background-color: #000;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.video-wrapper iframe,
.video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-info {
  padding: 20px;
}

.video-info h4 {
  margin-bottom: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
}

.video-meta {
  font-size: 0.9rem;
  color: var(--text-sub);
}

/* Video Filter Buttons */
.video-filter-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
  justify-content: center;
}

.vid-filter-btn {
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: var(--glass-blur);
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.3s;
}

.vid-filter-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.vid-filter-btn.active {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(255, 193, 7, 0.4);
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 40px 20px;
  font-size: 0.85rem;
  color: var(--text-sub);
  background: #000;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 50px;
}