/* ============================================
   INVINCIBLE GTG LEVELING COST CALCULATOR
   Theme: Blue overlay on cityscape background
   ============================================ */

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

/* --- CSS Variables --- */
:root {
  --bg-overlay: rgba(10, 131, 178, 0.55);
  --bg-card: rgba(0, 60, 90, 0.55);
  --bg-card-solid: #064a66;
  --bg-input: rgba(255, 255, 255, 0.08);

  --blue-accent: #3b82f6;
  --blue-light: #7dd3fc;
  --blue-dim: #1e3a5f;

  --yellow-primary: #fdee0d;
  --yellow-bright: #fdee0d;
  --yellow-dim: rgba(253, 238, 13, 0.15);

  --text-white: #f0f0f0;
  --text-light: #cce4ef;
  --text-muted: #7fb8d0;

  --border: rgba(255, 255, 255, 0.12);
  --border-hover: rgba(255, 255, 255, 0.22);

  --font-display: 'Oswald', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.25);

  --transition: 0.25s ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 14.4px;
}

body {
  font-family: var(--font-body);
  background: #0a83b2 url('Background.jpg') center / cover no-repeat fixed;
  color: var(--text-white);
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  line-height: 1.6;
  position: relative;
}

/* Blue overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-overlay);
  z-index: -1;
  pointer-events: none;
}

/* --- Container --- */
.container {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
  padding: 0 24px 80px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* --- Header --- */
.hero-section {
  text-align: center;
  padding: 50px 0 30px;
}

.hero-logo {
  max-width: 320px;
  width: 80%;
  height: auto;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero-divider {
  width: 100px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--yellow-primary), transparent);
  margin: 20px auto 0;
  border: none;
}

/* --- Input Fields --- */
.input-label {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-light);
}

.input-field {
  width: 100%;
  padding: 10px 0;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border);
  border-radius: 0;
  color: var(--text-white);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  transition: var(--transition);
  outline: none;
}

.input-field::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.input-field:hover {
  border-bottom-color: var(--border-hover);
}

.input-field:focus {
  border-bottom-color: var(--blue-accent);
}

.input-field[type="number"]::-webkit-outer-spin-button,
.input-field[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.input-field[type="number"] {
  -moz-appearance: textfield;
}

/* --- Level Range Inputs --- */
.leveling-inputs {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  margin-bottom: 28px;
}

.leveling-input-group {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leveling-input-group:hover {
  border-color: var(--border-hover);
}

.level-arrow {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-muted);
  padding-bottom: 12px;
}

/* --- Resource Result Cards --- */
.resource-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.resource-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
  border-top: 3px solid var(--resource-color, var(--border));
  transition: var(--transition);
}

.resource-card:hover {
  border-color: var(--border-hover);
}

.resource-card--gold    { --resource-color: #ffd700; }
.resource-card--xp      { --resource-color: #7dd3fc; }
.resource-card--special { --resource-color: #ef5350; }

.resource-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  margin-bottom: 8px;
}

.resource-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.resource-value {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--resource-color, var(--text-white));
  letter-spacing: 1px;
  line-height: 1.1;
}

.resource-raw {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
  min-height: 1.2em;
}

/* --- Summary --- */
.leveling-summary {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* --- Per-Level Breakdown --- */
.breakdown-section {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  margin-bottom: 40px;
}

.breakdown-toggle {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  transition: var(--transition);
}

.breakdown-toggle:hover {
  border-color: var(--border-hover);
  color: var(--text-light);
}

.breakdown-arrow {
  font-size: 0.7rem;
  transition: transform 0.3s ease;
}

.breakdown-arrow.open {
  transform: rotate(180deg);
}

.breakdown-panel {
  margin-top: 8px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0;
  overflow: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.breakdown-panel.collapsed {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

/* --- Level Table --- */
.level-table-wrapper {
  max-height: 400px;
  overflow-y: auto;
}

.level-table-wrapper::-webkit-scrollbar {
  width: 6px;
}

.level-table-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.level-table-wrapper::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.level-table {
  width: 100%;
  border-collapse: collapse;
}

.level-table th {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card-solid);
}

.level-table th:first-child {
  text-align: left;
}

.level-table td {
  padding: 6px 12px;
  text-align: right;
  color: var(--text-light);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.8rem;
}

.level-table td:first-child {
  text-align: left;
  color: var(--text-white);
  font-weight: 600;
}

.level-table tr.special-level td {
  background: rgba(253, 238, 13, 0.05);
}

.level-table tr.special-level td:first-child {
  color: var(--yellow-primary);
}

.table-note td {
  text-align: center !important;
  font-style: italic;
  color: var(--text-muted);
  padding: 12px;
}

/* --- Discord Widget --- */
.discord-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #5865F2;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: background 0.2s ease, transform 0.2s ease;
}

.discord-widget:hover {
  background: #4752c4;
  transform: translateY(-2px);
}

.discord-widget svg {
  flex-shrink: 0;
}

/* --- Utility --- */
.hidden {
  display: none !important;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .container {
    padding: 0 16px 60px;
  }

  .hero-section {
    padding: 30px 0 20px;
  }

  .leveling-inputs {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .leveling-input-group {
    flex: 0 0 auto;
    width: 100%;
    max-width: 280px;
  }

  .level-arrow {
    transform: rotate(90deg);
    padding: 0;
  }

  .resource-cards {
    grid-template-columns: 1fr;
  }

  .discord-widget {
    display: none;
  }
}
