/* ===========================
   GPA CALCULATOR – VHU
   Ocean Blue Theme
   =========================== */

:root {
  --ocean-deep:   #042c53;
  --ocean-dark:   #0c447c;
  --ocean-mid:    #185fa5;
  --ocean-main:   #1976d2;
  --ocean-light:  #42a5f5;
  --ocean-pale:   #90caf9;
  --ocean-foam:   #e3f2fd;
  --ocean-mist:   #f0f8ff;

  --accent:       #00e5ff;
  --accent2:      #40c4ff;
  --white:        #ffffff;

  --text-primary: #01224a;
  --text-muted:   #4a7aaa;
  --text-light:   #7dadd4;

  --radius-sm:    8px;
  --radius-md:    14px;
  --radius-lg:    20px;
  --radius-xl:    28px;

  --shadow-card:  0 8px 32px rgba(4, 44, 83, 0.18), 0 2px 8px rgba(4, 44, 83, 0.10);
  --shadow-float: 0 20px 60px rgba(4, 44, 83, 0.22);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--ocean-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== OCEAN BACKGROUND ===== */
.ocean-bg {
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, #011e3e 0%, #042c53 40%, #0a3d6b 70%, #0d4f85 100%);
  z-index: 0;
  overflow: hidden;
}

.wave {
  position: absolute;
  width: 220%;
  height: 200px;
  bottom: 0;
  left: -60%;
  border-radius: 50%;
  animation: waveMove linear infinite;
  opacity: 0.15;
}

.w1 {
  background: radial-gradient(ellipse, #1976d2 0%, transparent 70%);
  height: 320px;
  animation-duration: 14s;
  bottom: -60px;
}

.w2 {
  background: radial-gradient(ellipse, #42a5f5 0%, transparent 60%);
  height: 240px;
  animation-duration: 20s;
  animation-direction: reverse;
  bottom: -30px;
  opacity: 0.10;
}

.w3 {
  background: radial-gradient(ellipse, #00e5ff 0%, transparent 55%);
  height: 180px;
  animation-duration: 25s;
  bottom: 0;
  opacity: 0.07;
}

@keyframes waveMove {
  0%   { transform: translateX(0) scaleY(1); }
  50%  { transform: translateX(8%) scaleY(1.08); }
  100% { transform: translateX(0) scaleY(1); }
}

/* ===== CONTAINER ===== */
.container {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

/* ===== HEADER ===== */
.header {
  text-align: center;
  margin-bottom: 2.5rem;
  animation: fadeDown 0.6s ease both;
}

.header-badge {
  display: inline-block;
  font-family: 'Syne', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--accent);
  background: rgba(0, 229, 255, 0.10);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 100px;
  padding: 5px 16px;
  margin-bottom: 1rem;
}

.header-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2.2rem, 8vw, 3.4rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 0.5rem;
}

.header-title .accent {
  color: var(--accent);
  position: relative;
}

.header-title .accent::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  opacity: 0.5;
}

.header-sub {
  font-size: 14px;
  color: var(--ocean-pale);
  font-style: italic;
}

/* ===== GPA CARD ===== */
.gpa-card {
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-float);
  animation: fadeUp 0.7s 0.1s ease both;
}

.gpa-card-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.gpa-left { flex: 1; }

.gpa-label-sm {
  font-family: 'Syne', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--ocean-pale);
  margin-bottom: 8px;
}

.gpa-number {
  font-family: 'Syne', sans-serif;
  font-size: 4.5rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
  letter-spacing: -3px;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gpa-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.gpa-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.12);
  border-radius: 100px;
  overflow: hidden;
}

.gpa-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ocean-light), var(--accent));
  border-radius: 100px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gpa-bar-max {
  font-size: 12px;
  color: var(--ocean-pale);
  white-space: nowrap;
}

.gpa-divider {
  width: 1px;
  height: 100px;
  background: rgba(255,255,255,0.12);
  flex-shrink: 0;
}

.gpa-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  min-width: 140px;
}

.gpa-rank-badge {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 100px;
  padding: 8px 22px;
  letter-spacing: 1px;
  text-align: center;
  transition: all 0.4s ease;
}

.stats-mini {
  display: flex;
  gap: 1.5rem;
}

.sm-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.sm-val {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
}

.sm-lbl {
  font-size: 10px;
  color: var(--ocean-pale);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== SUBJECTS SECTION ===== */
.subjects-section {
  animation: fadeUp 0.7s 0.2s ease both;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
}

.btn-add {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--ocean-main);
  color: var(--white);
  border: none;
  border-radius: 100px;
  padding: 8px 18px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(25,118,210,0.35);
}

.btn-add:hover {
  background: var(--ocean-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(66,165,245,0.45);
}

.btn-plus {
  font-size: 18px;
  line-height: 1;
}

.subjects-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ===== SUBJECT ROW ===== */
.subject-row {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  transition: all 0.2s ease;
  animation: slideIn 0.3s ease both;
}

.subject-row:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(66,165,245,0.3);
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.row-num {
  font-family: 'Syne', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--ocean-pale);
  min-width: 20px;
}

.input-name {
  flex: 1;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--white);
  outline: none;
  transition: border-color 0.2s;
}

.input-name::placeholder { color: rgba(255,255,255,0.3); }

.input-name:focus {
  border-color: rgba(66,165,245,0.5);
  background: rgba(255,255,255,0.11);
}

.select-tc {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--white);
  outline: none;
  cursor: pointer;
  width: 88px;
}

.select-tc option { background: var(--ocean-dark); color: var(--white); }

.grade-badge {
  min-width: 46px;
  text-align: center;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  transition: all 0.3s ease;
}

.btn-del {
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  width: 32px;
  height: 32px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-del:hover {
  background: rgba(226,75,74,0.2);
  border-color: rgba(226,75,74,0.4);
  color: #ff6b6b;
}

.row-scores {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  align-items: end;
}

.score-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.score-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--ocean-pale);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.input-score {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--white);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  width: 100%;
  -moz-appearance: textfield;
}

.input-score::-webkit-outer-spin-button,
.input-score::-webkit-inner-spin-button { -webkit-appearance: none; }

.input-score::placeholder { color: rgba(255,255,255,0.2); font-size: 13px; font-weight: 400; }

.input-score:focus {
  border-color: rgba(66,165,245,0.5);
  background: rgba(255,255,255,0.12);
}

.score-result {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.score-result-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--ocean-pale);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.score-result-val {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  height: 40px;
}

.avg-10 {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
}

.arrow-sep { color: rgba(255,255,255,0.3); font-size: 12px; }

.avg-4 {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

/* ===== GRADE COLORS ===== */
.grade-a  { background: rgba(0,200,120,0.2); color: #4dffa0; border: 1px solid rgba(0,200,120,0.3); }
.grade-bp { background: rgba(66,165,245,0.2); color: #90caf9; border: 1px solid rgba(66,165,245,0.3); }
.grade-b  { background: rgba(25,118,210,0.2); color: #64b5f6; border: 1px solid rgba(25,118,210,0.3); }
.grade-cp { background: rgba(255,193,7,0.2); color: #ffe082; border: 1px solid rgba(255,193,7,0.3); }
.grade-c  { background: rgba(255,152,0,0.2); color: #ffcc80; border: 1px solid rgba(255,152,0,0.3); }
.grade-dp { background: rgba(255,87,34,0.2); color: #ffab91; border: 1px solid rgba(255,87,34,0.3); }
.grade-d  { background: rgba(244,67,54,0.2); color: #ef9a9a; border: 1px solid rgba(244,67,54,0.3); }
.grade-fp { background: rgba(156,39,176,0.2); color: #ce93d8; border: 1px solid rgba(156,39,176,0.3); }
.grade-f  { background: rgba(96,0,0,0.3); color: #ff8a80; border: 1px solid rgba(244,67,54,0.3); }

/* ===== TABLE SECTION ===== */
.table-section {
  margin-top: 2rem;
  animation: fadeUp 0.7s 0.3s ease both;
}

.table-details {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  cursor: pointer;
  list-style: none;
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--ocean-pale);
  letter-spacing: 0.5px;
  user-select: none;
  transition: color 0.2s;
}

.table-summary:hover { color: var(--white); }

.table-summary::-webkit-details-marker { display: none; }

.summary-arrow {
  transition: transform 0.3s ease;
  font-size: 14px;
}

details[open] .summary-arrow { transform: rotate(180deg); }

.table-wrap {
  padding: 0 1rem 1rem;
  overflow-x: auto;
}

.conv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.conv-table th {
  padding: 8px 12px;
  background: rgba(255,255,255,0.06);
  color: var(--ocean-pale);
  font-family: 'Syne', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.conv-table td {
  padding: 8px 12px;
  color: rgba(255,255,255,0.75);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.conv-table tr:last-child td { border-bottom: none; }
.conv-table tr:hover td { background: rgba(255,255,255,0.04); }

.grade-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-family: 'Syne', sans-serif;
  font-size: 11px;
  font-weight: 700;
}

.grade-pill.a  { background: rgba(0,200,120,0.2); color: #4dffa0; }
.grade-pill.bp { background: rgba(66,165,245,0.2); color: #90caf9; }
.grade-pill.b  { background: rgba(25,118,210,0.2); color: #64b5f6; }
.grade-pill.cp { background: rgba(255,193,7,0.2); color: #ffe082; }
.grade-pill.c  { background: rgba(255,152,0,0.2); color: #ffcc80; }
.grade-pill.dp { background: rgba(255,87,34,0.2); color: #ffab91; }
.grade-pill.d  { background: rgba(244,67,54,0.2); color: #ef9a9a; }
.grade-pill.fp { background: rgba(156,39,176,0.2); color: #ce93d8; }
.grade-pill.f  { background: rgba(96,0,0,0.3); color: #ff8a80; }

.result-pass { color: #4dffa0; font-weight: 500; }
.result-fail { color: #ff8a80; font-weight: 500; }

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  margin-top: 2.5rem;
  font-size: 12px;
  color: rgba(255,255,255,0.25);
  font-style: italic;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 540px) {
  .gpa-card-inner { flex-direction: column; gap: 1.25rem; }
  .gpa-divider { width: 100%; height: 1px; }
  .gpa-number { font-size: 3.5rem; }
  .row-scores { grid-template-columns: 1fr 1fr; }
  .score-result { grid-column: span 2; }
  .stats-mini { gap: 1rem; }
}

@media (max-width: 380px) {
  .row-scores { grid-template-columns: 1fr; }
  .score-result { grid-column: span 1; }
}
