:root {
  --primary: #0f4c81;
  --primary-dark: #092e4e;
  --secondary: #1a73e8;
  --bg-color: #f4f6f9;
  --surface: #ffffff;
  --text-main: #202124;
  --text-sub: #5f6368;
  --border: #e8eaed;
  --blue: #1a73e8;
  --yellow: #fbbc04;
  --red: #ea4335;
  --green: #34a853;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Pretendard', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Header & Nav */
.app-header {
  background-color: var(--primary);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.logo {
  font-size: 1.2rem;
  padding: 15px 20px;
  font-weight: 700;
  color: white;
}

.nav-bar {
  display: flex;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-btn {
  flex: 1;
  padding: 12px 0;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  font-size: 0.95rem;
  text-align: center;
  transition: all 0.2s;
}

.nav-btn.active {
  color: var(--white);
  font-weight: 700;
  border-bottom: 3px solid var(--white);
  background: rgba(0, 0, 0, 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.3s ease;
}

.page-view.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Home View Elements */
.hero-section {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 12px;
  padding: 30px 20px;
  color: white;
  text-align: center;
  margin-bottom: 25px;
  box-shadow: var(--shadow);
}

.hero-section h2 {
  font-size: 1.5rem;
  line-height: 1.4;
  margin-bottom: 15px;
}

.highlight {
  color: #fbbc04;
  font-weight: 900;
}

.hero-sub {
  font-size: 0.95rem;
  opacity: 0.9;
  margin-bottom: 20px;
}

.btn-primary {
  background-color: white;
  color: var(--primary);
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.1s;
}

.btn-primary.PWA-btn {
  background-color: var(--yellow);
  color: #333;
  width: 100%;
  max-width: 300px;
}

.btn-primary:active {
  transform: scale(0.98);
}

.hidden {
  display: none !important;
}

/* Trust Builder */
.trust-builder {
  display: flex;
  align-items: center;
  background: var(--surface);
  padding: 15px 20px;
  border-radius: 10px;
  border-left: 5px solid var(--blue);
  margin-bottom: 25px;
  box-shadow: var(--shadow);
}

.trust-icon {
  font-size: 2rem;
  margin-right: 15px;
}

.trust-text p {
  font-size: 0.95rem;
}

.trust-sub {
  font-size: 0.85rem;
  color: var(--text-sub);
  margin-top: 4px;
}

.badge-blue {
  background: rgba(26, 115, 232, 0.1);
  color: var(--blue);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.8rem;
}

/* Quick Access Cards */
.quick-access {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  margin-bottom: 30px;
}

@media (min-width: 600px) {
  .quick-access {
    grid-template-columns: repeat(3, 1fr);
  }
}

.qa-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.qa-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--primary);
}

.qa-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.qa-card h3 {
  font-size: 1.1rem;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.qa-card p {
  font-size: 0.85rem;
  color: var(--text-sub);
}

/* Top Performers */
.top-performers-section {
  padding: 20px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.section-title {
  font-size: 1.2rem;
  margin-bottom: 5px;
  color: var(--text-main);
}

.section-desc {
  font-size: 0.9rem;
  color: var(--text-sub);
  margin-bottom: 15px;
}

.performer-list {
  list-style: none;
}

.performer-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
}

.performer-item:last-child {
  border-bottom: none;
}

.per-info strong {
  display: block;
  font-size: 1.05rem;
}

.per-info span {
  font-size: 0.8rem;
  color: var(--text-sub);
}

.per-stat {
  background: rgba(52, 168, 83, 0.1);
  color: var(--green);
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
}

/* General View Styles */
.view-title {
  font-size: 1.4rem;
  color: var(--primary-dark);
  margin-bottom: 5px;
}

.view-title span {
  font-size: 1rem;
  color: var(--text-sub);
  font-weight: 400;
}

.view-desc {
  font-size: 0.95rem;
  color: var(--text-sub);
  margin-bottom: 20px;
}

/* Table Styles */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 15px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
  text-align: center;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.data-table th {
  background-color: #f1f3f4;
  color: var(--text-sub);
  font-weight: 700;
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background-color: rgba(26, 115, 232, 0.03);
}

.score-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
}

.score-good {
  background-color: rgba(26, 115, 232, 0.1);
  color: var(--blue);
}

.score-warn {
  background-color: rgba(251, 188, 4, 0.15);
  color: #d99a00;
}

.score-bad {
  background-color: rgba(234, 67, 53, 0.1);
  color: var(--red);
}

.table-legend {
  font-size: 0.85rem;
  color: var(--text-sub);
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.legend-item {
  margin-right: 15px;
  display: inline-flex;
  align-items: center;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
}

.dot.blue {
  background-color: var(--blue);
}

.dot.yellow {
  background-color: var(--yellow);
}

.dot.red {
  background-color: var(--red);
}

.legend-note {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

/* Chart Area */
.chart-wrapper {
  width: 100%;
  height: 300px;
  position: relative;
}

@media (min-width: 600px) {
  .chart-wrapper {
    height: 350px;
  }
}

/* Calculator Form */
.calc-form {
  background: var(--surface);
  padding: 20px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 25px;
  border: 1px solid var(--border);
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.input-box {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}

.form-row {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.form-group.half {
  flex: 1;
  min-width: 140px;
  background: var(--bg-color);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 0;
}

.label-danger {
  color: var(--red) !important;
}

.label-success {
  color: var(--blue) !important;
}

.input-info {
  font-size: 0.8rem;
  color: var(--text-sub);
  margin-top: 4px;
}

.full-width {
  width: 100%;
  background-color: var(--primary);
  color: white;
  margin-top: 10px;
}

/* Chart Results */
.result-area {
  background: var(--surface);
  padding: 25px 20px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--blue);
}

.result-title {
  text-align: center;
  margin-bottom: 20px;
  color: var(--primary-dark);
}

.chart-container {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  height: 250px;
  padding-bottom: 30px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
  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: 60px;
  height: 80%;
  background: #f1f3f4;
  border-radius: 8px 8px 0 0;
  position: relative;
  display: flex;
  align-items: flex-end;
}

.bar {
  width: 100%;
  border-radius: 8px 8px 0 0;
  transition: height 1s cubic-bezier(0.1, 0.7, 0.1, 1);
}

.fill-red {
  background: linear-gradient(to top, #ea4335, #ff6d60);
}

.fill-blue {
  background: linear-gradient(to top, #1a73e8, #60a1fa);
}

.bar-value {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}

.bar-label {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 10px;
  color: var(--text-sub);
}

.saving-card {
  background: rgba(26, 115, 232, 0.05);
  text-align: center;
  padding: 20px;
  border-radius: 8px;
  border: 1px dashed var(--blue);
}

.saving-card h4 {
  color: var(--text-main);
  margin-bottom: 5px;
}

.saving-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 5px;
}

.saving-percent {
  font-size: 0.95rem;
  color: var(--text-sub);
}

/* Video Gallery */
.video-grid {
  display: grid;
  gap: 15px;
  grid-template-columns: 1fr;
}

@media (min-width: 600px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.video-card {
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  /* 16:9 ratio */
  height: 0;
  background-color: #000;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-info {
  padding: 15px;
}

.video-info h4 {
  margin-bottom: 5px;
  color: var(--primary-dark);
}

.video-meta {
  font-size: 0.85rem;
  color: var(--text-sub);
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 30px 20px;
  font-size: 0.8rem;
  color: var(--text-sub);
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}