/* ==========================================
   THEME VARIABLES
   ========================================== */

/* Default: Dark Mode */
:root {
  /* Modern Slate/Navy Backgrounds */
  --bg-color: #060b14;
  --gradient-top: #101c38;
  --gradient-bottom: #060b14;
  --grid-line: rgba(255, 255, 255, 0.03);

  /* Clean UI Panels */
  --panel-bg: rgba(15, 23, 42, 0.75);
  --panel-border: rgba(13, 133, 175, 0.2);
  --card-bg: rgba(30, 41, 59, 0.6);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-light: rgba(255, 255, 255, 0.05);

  --footer-bg: rgba(6, 11, 20, 0.95);
  --contact-bg: rgba(15, 23, 42, 0.5);
  --track-bg: rgba(0, 0, 0, 0.6);
  --input-bg: rgba(15, 23, 42, 0.8);

  --shadow-color: rgba(0, 0, 0, 0.5);
  --shadow-heavy: rgba(0, 0, 0, 0.7);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;

  /* Global Interactive Colors */
  --color-primary: #0d85af;
  --color-hover: #212968;
  --color-active: #debe3e;

  /* Button Specific Variables */
  --btn-bg: var(--color-primary);
  --btn-hover: var(--color-hover);
  --btn-active: var(--color-active);
  --btn-text: #ffffff;
  --btn-text-active: #000000;

  /* Text Accents & Outlines */
  --text-accent-1: #4fc3f7; /* Lighter blue for dark mode readability */
  --text-accent-2: var(--color-active);
  --input-focus-border: var(--color-primary);

  /* Glows */
  --focus-ring: rgba(13, 133, 175, 0.5);
  --glow-primary: rgba(13, 133, 175, 0.4);
  --glow-hover: rgba(33, 41, 104, 0.6);
  --glow-active: rgba(222, 190, 62, 0.4);
}

/* Automatic Light Mode Alternative */
@media (prefers-color-scheme: light) {
  :root {
    /* Bright, Crisp Slate Backgrounds */
    --bg-color: #f1f5f9;
    --gradient-top: #e2e8f0;
    --gradient-bottom: #f1f5f9;
    --grid-line: rgba(0, 0, 0, 0.04);

    /* Light UI Panels */
    --panel-bg: rgba(255, 255, 255, 0.85);
    --panel-border: rgba(15, 23, 42, 0.1);
    --card-bg: rgba(248, 250, 252, 0.9);
    --border-color: rgba(15, 23, 42, 0.1);
    --border-light: rgba(15, 23, 42, 0.05);

    --footer-bg: rgba(241, 245, 249, 0.95);
    --contact-bg: rgba(255, 255, 255, 0.7);
    --track-bg: rgba(15, 23, 42, 0.1);
    --input-bg: rgba(255, 255, 255, 0.9);

    --shadow-color: rgba(15, 23, 42, 0.08);
    --shadow-heavy: rgba(15, 23, 42, 0.15);

    --text-main: #0f172a;
    --text-muted: #475569;

    /* Global Interactive Colors */
    --color-primary: #0d85af;
    --color-hover: #1e255e; /* Slightly darker for light mode contrast */
    --color-active: #b89c2e; /* Darker gold for text readability */

    /* Button Specific Variables */
    --btn-bg: var(--color-primary);
    --btn-hover: var(--color-hover);
    --btn-active: #debe3e; /* Keep button gold bright */
    --btn-text: #ffffff;
    --btn-text-active: #000000;

    /* Text Accents & Outlines */
    --text-accent-1: #0a698a;
    --text-accent-2: var(--color-active);
    --input-focus-border: var(--color-primary);

    /* Glows */
    --focus-ring: rgba(13, 133, 175, 0.4);
    --glow-primary: rgba(13, 133, 175, 0.3);
    --glow-hover: rgba(30, 37, 94, 0.3);
    --glow-active: rgba(184, 156, 46, 0.3);
  }
}

/* ==========================================
   GLOBAL STYLES & TYPOGRAPHY
   ========================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background-color: var(--bg-color);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--gradient-top), var(--gradient-bottom));
  background-size:
    24px 24px,
    24px 24px,
    100% 100%;
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Global Hyperlinks */
a {
  color: var(--text-accent-1);
  text-decoration: underline;
  text-decoration-color: var(--text-accent-1);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--color-hover);
  text-decoration-color: var(--color-hover);
}

/* Reusable Containers */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* ==========================================
   HERO SECTION
   ========================================== */

.hero {
  padding: 80px 0;
  margin-bottom: 20px;
}

.hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 60px;
}

@media (min-width: 768px) {
  .hero-container {
    flex-direction: row;
    justify-content: space-between;
  }
}

.hero-content {
  flex: 1;
  text-align: center;
}

@media (min-width: 768px) {
  .hero-content {
    text-align: left;
  }
}

.hero-logo {
  width: 100%;
  max-width: 450px;
  height: auto;
  display: block;
  margin: 0 auto 12px auto;
  filter: drop-shadow(0 4px 12px var(--shadow-heavy));
}

@media (min-width: 768px) {
  .hero-logo {
    margin: 0 0 12px 0;
  }
}

.hero-subtitle {
  font-size: clamp(1.2rem, 3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-accent-1);
  margin-bottom: 24px;
  text-shadow: 0 0 12px var(--glow-primary);
  text-transform: uppercase;
}

.hero-content p {
  color: var(--text-muted);
  font-size: 1.125rem;
  max-width: 500px;
  margin: 0 auto 32px auto;
}

.hero-content p.lead {
  font-size: 1.35rem;
  color: var(--text-main);
  font-weight: 500;
  margin-bottom: 16px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

@media (min-width: 768px) {
  .hero-buttons {
    justify-content: flex-start;
  }
  .hero-content p {
    margin: 0 0 32px 0;
  }
  .hero-content p.lead {
    margin: 0 0 16px 0;
  }
}

.hero-visual {
  flex: 1;
  display: flex;
  justify-content: center;
  width: 100%;
}

.hero-mockup {
  width: 100%;
  max-width: 600px;
  height: auto;
  aspect-ratio: 1500 / 1043;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 20px 40px var(--shadow-heavy));
}

/* ==========================================
   RESOLUTION INFO SECTION
   ========================================== */

.resolution-info {
  margin: 40px 0 60px 0;
}

.resolution-info .container {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 40px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 40px var(--shadow-color);
}

.res-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .res-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.res-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
}

.res-card h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.res-card.standard h3 {
  color: var(--text-accent-1);
}
.res-card.high h3 {
  color: var(--text-accent-2);
}

.res-card p {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 16px;
}

.res-specs {
  list-style: none;
  font-size: 0.95rem;
  color: var(--text-main);
}

.res-specs li {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.res-specs li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* ==========================================
   PROGRESS BAR SECTION
   ========================================== */

.progress-section.container {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 40px;
  margin-bottom: 60px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 40px var(--shadow-color);
}

.progress-header {
  margin-bottom: 32px;
}

.progress-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
}

.last-updated {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 6px;
  font-weight: 500;
  opacity: 0.8;
}

.progress-item {
  margin-bottom: 32px;
}

.progress-item:last-child {
  margin-bottom: 0;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 12px;
}

.progress-labels span:first-child {
  color: var(--text-main);
  font-weight: 600;
  font-size: 1.15rem;
}

.progress-labels span:last-child {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 1.05rem;
}

.progress-track {
  width: 100%;
  height: 28px;
  background-color: var(--track-bg);
  border-radius: 14px;
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 14px;
  transition: width 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Unified Theme Gradients for Bars */
.scanned-fill {
  background: linear-gradient(90deg, #99801f, var(--color-active));
  box-shadow: 0 0 15px var(--glow-active);
}

.optimised-fill {
  background: linear-gradient(90deg, #095975, var(--color-primary));
  box-shadow: 0 0 15px var(--glow-primary);
}

@media (max-width: 600px) {
  .progress-section.container {
    padding: 24px 16px;
  }
  .progress-labels {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* ==========================================
   MAIN CONTENT & ISSUES GRID
   ========================================== */

main.container {
  flex: 1;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 40px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 40px var(--shadow-color);
  margin-bottom: 80px;
}

@media (max-width: 600px) {
  main.container {
    padding: 24px 16px;
  }
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
}

@media (min-width: 600px) {
  .section-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}

.section-title h2 {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.section-title p {
  color: var(--text-accent-1);
  font-size: 1rem;
  font-weight: 500;
}

.search-container {
  width: 100%;
  max-width: 320px;
}

.search-input {
  width: 100%;
  padding: 12px 16px;
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.empty-state {
  display: none;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
  font-size: 1.125rem;
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px dashed var(--border-color);
  grid-column: 1 / -1;
}

/* Card Component */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border-color);
  transition:
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  display: flex;
  flex-direction: row;
  gap: 20px;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--color-primary);
  box-shadow:
    0 10px 20px var(--shadow-color),
    0 0 15px var(--glow-primary);
}

.card-left {
  flex: 0 0 120px;
}

.card-thumbnail {
  width: 100%;
  height: auto;
  aspect-ratio: 240 / 310;
  object-fit: cover;
  border-radius: 8px;
  background-color: #000;
  border: 1px solid var(--border-light);
  display: block;
}

.card-right {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-header {
  margin-bottom: 16px;
}

.card-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.card-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ==========================================
   BUTTONS
   ========================================== */

.button-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

/* Ensures all buttons ignore global link styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-inline {
  width: fit-content;
  padding: 12px 24px;
}

.btn-large {
  font-size: 1.125rem;
  padding: 16px 32px;
}

.btn:focus-visible {
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.btn:active {
  transform: scale(0.95);
}

.btn-primary,
.btn-secondary {
  background-color: var(--btn-bg);
  color: var(--btn-text) !important;
}

.btn-primary:hover,
.btn-secondary:hover {
  background-color: var(--btn-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--glow-hover);
}

.btn-primary:active,
.btn-secondary:active {
  background-color: var(--btn-active);
  color: var(--btn-text-active) !important;
  box-shadow: 0 0 5px var(--glow-active);
}

/* ==========================================
   INFO & PRIVACY STATEMENTS
   ========================================== */

.project-info {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 2px solid var(--border-color);
}

.info-block {
  margin-bottom: 40px;
}

.info-block:last-child {
  margin-bottom: 0;
}

.info-block h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-main);
}

.info-block p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 16px;
  max-width: 900px;
}

.info-block .warning {
  color: var(--text-accent-2);
  font-weight: 600;
}

/* ==========================================
   FOOTER
   ========================================== */

footer {
  background-color: var(--footer-bg);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
  position: relative;
  z-index: 10;
}

.footer-container {
  padding: 60px 20px;
}

.contact-box {
  background-color: var(--contact-bg);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  margin-bottom: 60px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 20px var(--shadow-color);
}

.contact-box h3 {
  font-size: 1.75rem;
  margin-bottom: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.contact-box p {
  color: var(--text-muted);
  margin-bottom: 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.05rem;
}

.contact-box .btn-secondary {
  margin: 0 auto;
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
  border-top: 1px solid var(--border-light);
  padding-top: 32px;
}

@media (min-width: 600px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 600px;
}

.footer-bottom a {
  font-size: 0.9rem;
  font-weight: 500;
}

@media (max-width: 400px) {
  .card {
    flex-direction: column;
  }
  .card-left {
    flex: none;
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
  }
}
