:root {
  /* Dark Theme Palette */
  --bg-main: #121212;
  --bg-card: #1e1e1e;
  --bg-hover: #2c2c2c;
  --accent: #f59e0b; /* Construction Amber/Orange */
  --accent-hover: #d97706;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --border-color: #333333;
  --navbar-height: 60px;
  --bottom-nav-height: 65px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  padding-bottom: calc(var(--bottom-nav-height) + 20px);
}

a {
  text-decoration: none;
  color: var(--text-main);
  transition: color 0.3s ease;
}

/* --- TOP NAVBAR --- */
.topbar {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--navbar-height);
  background-color: var(--bg-card);
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
}

.topbar nav {
  display: flex;
  gap: 30px;
}

.topbar nav a {
  font-weight: 500;
  font-size: 15px;
}

.topbar nav a:hover, .topbar nav a.active {
  color: var(--accent);
}

/* --- MAIN CONTAINER --- */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: calc(var(--navbar-height) + 20px) 20px 20px;
}

/* --- BUTTONS --- */
.btn-primary {
  display: block;
  width: 100%;
  background-color: var(--accent);
  color: #121212;
  border: none;
  padding: 15px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 15px;
  transition: background 0.3s ease, transform 0.1s;
  text-align: center;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-hover);
  color: var(--accent);
}

/* --- SOCIAL SECTION --- */
.social-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
}

.social-links img {
  width: 32px;
  height: 32px;
  filter: brightness(0.8);
  transition: filter 0.3s ease;
}

.social-links img:hover {
  filter: brightness(1.2);
}

/* --- ARTICLE/BLOG SECTION --- */
.section-title {
  font-size: 20px;
  font-weight: 600;
  margin: 30px 0 15px;
  border-left: 4px solid var(--accent);
  padding-left: 10px;
}

.article-card {
  background-color: var(--bg-card);
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
  border: 1px solid var(--border-color);
}

.article-card h1 {
  font-size: 22px;
  margin-bottom: 10px;
  color: var(--accent);
}

.article-step-title {
  font-weight: 600;
  margin-top: 20px;
  color: var(--text-main);
}

.article-img {
  width: 100%;
  border-radius: 8px;
  margin: 10px 0;
  border: 1px solid var(--border-color);
}

.expand-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  padding: 10px 0;
  font-size: 15px;
}

/* --- BOTTOM MOBILE NAV --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  height: var(--bottom-nav-height);
  background-color: var(--bg-card);
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid var(--border-color);
  z-index: 1000;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.nav-item img {
  width: 24px;
  height: 24px;
  filter: grayscale(1) opacity(0.7);
}

.nav-item.active {
  color: var(--accent);
}

.nav-item.active img {
  filter: none;
}

/* Hide top nav on mobile, hide bottom nav on desktop */
@media (max-width: 768px) {
  .topbar { display: none; }
  .container { padding-top: 20px; }
}
@media (min-width: 769px) {
  .bottom-nav { display: none; }
  body { padding-bottom: 20px; }
}


/* --- APP GRID (programs.php) --- */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 15px;
  margin-bottom: 35px;
}

.app-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 15px 10px;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.app-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
}

.app-card img {
  width: 50px;
  height: 50px;
  margin-bottom: 10px;
  /* Adds a subtle dark shadow to the icons to make them pop on dark backgrounds */
  filter: drop-shadow(0 4px 4px rgba(0,0,0,0.4)); 
}

.app-card h3 {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.2;
}


/* --- CONTACT PAGE --- */
.contact-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 15px 20px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 15px;
  font-weight: 500;
  transition: transform 0.2s, border-color 0.2s;
}

.contact-card:hover {
  transform: translateX(5px);
  border-color: var(--accent);
}

.contact-card img {
  width: 30px;
  height: 30px;
}

.about-box {
  background-color: var(--bg-hover);
  padding: 20px;
  border-radius: 12px;
  border-left: 4px solid var(--accent);
  margin-top: 30px;
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.8;
}

.site-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 50px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.site-footer a {
  color: var(--accent);
  text-decoration: underline;
}


/* --- CALCULATOR FORMS & TABLES --- */
.calc-form {
  background-color: var(--bg-card);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin-bottom: 30px;
}

.input-group {
  margin-bottom: 15px;
}

.input-group label {
  display: block;
  font-size: 14px;
  margin-bottom: 5px;
  color: var(--text-muted);
}

.input-group input[type="number"] {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-main);
  color: var(--text-main);
  font-size: 16px;
  outline: none;
}

.input-group input[type="number"]:focus {
  border-color: var(--accent);
}

.result-container {
  display: none; /* Hidden until calculated */
  background-color: var(--bg-card);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin-top: 20px;
  margin-bottom: 10px;
  scroll-margin-top: calc(var(--navbar-height) + 20px);
}

.calc-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  font-size: 14px;
}

.calc-table th, .calc-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.calc-table th {
  color: var(--accent);
  font-weight: 600;
}

.calc-table input[type="number"], .calc-table input[type="text"] {
  width: 70px;
  background: var(--bg-main);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 5px;
}

.calc-table .strikethrough td {
  text-decoration: line-through;
  opacity: 0.5;
}

.total-cost-box {
  font-size: 22px; 
  font-weight: bold; 
  color: var(--text-main); /* Text in light gray */
  margin-bottom: 20px; 
  padding-bottom: 15px; 
  border-bottom: 1px solid var(--border-color);
}

.total-cost-box span {
  color: var(--text-main); /* Number in construction amber */
}

.calc-table sup {
  font-size: 10px;
}

.radio-group {
  display: flex;
  gap: 20px;
  margin: 15px 0;
}

.radio-group label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.total-cost-box {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 15px;
}

.info-note {
  font-size: 13px;
  color: var(--text-main);
  margin-top: 20px;
  padding: 10px;
  background: var(--bg-main);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}

/* --- PRINT STYLES --- */
@media print {
  /* Hide navigation, forms, buttons, and SEO text */
  .topbar, .bottom-nav, .calc-form, button, .seo-content { 
      display: none !important; 
  }
  
  /* Hide the page title and reference image */
  h1.section-title, img[alt="Reference"] {
      display: none !important;
  }
  
  /* Format the Smeta Title input to look like normal text */
  #smetaTitle {
      border: none !important;
      background: transparent !important;
      padding: 0 !important;
      font-size: 18px !important;
      font-weight: bold !important;
      color: black !important;
      margin-bottom: 20px !important;
  }
  
  /* Hide the placeholder text when printing */
  #smetaTitle::placeholder {
      color: transparent !important;
  }

  /* Make sure background colors (if any) print well and text is black */
  body { 
      background: white !important; 
      color: black !important; 
  }
  
  .calc-table th, .calc-table td { 
      border-bottom: 1px solid #ccc !important; 
      color: black !important;
  }
  
  .calc-table input {
      border: none !important;
      background: transparent !important;
      color: black !important;
  }
  
  .result-container { 
      border: none !important; 
      padding: 0 !important;
  }
}


/* --- UPDATED RADIO GROUP FOR DARK THEME & MOBILE --- */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 15px 0;
}

.radio-group label {
  flex: 1;
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  background-color: var(--bg-main);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  text-align: center;
}

/* Hide native browser radio dot */
.radio-group label input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  outline: none;
  margin: 0;
  display: inline-block;
  vertical-align: middle;
  position: relative;
  transition: all 0.2s ease;
}

/* Active Radio Button States */
.radio-group label:has(input:checked) {
  background-color: var(--bg-hover);
  color: var(--accent);
  border-color: var(--accent);
}

.radio-group label input[type="radio"]:checked {
  border-color: var(--accent);
  background-color: var(--accent);
}

/* Stack options individually on mobile */
@media (max-width: 480px) {
  .radio-group {
    flex-direction: column;
    gap: 10px;
  }
  
  .radio-group label {
    width: 100%;
    flex: none;
  }
}


/* Kalkulyator daxilindəki bütün inline gridlərin başlıqlarını eyni xəttə gətirir */
.calc-form div[style*="grid"] .input-group label {
    min-height: 42px;
    display: flex;
    align-items: flex-end;
    margin-bottom: 8px;
}

/* Mobil telefonlarda (max 480px) inline yazılmış grid sütunlarını avtomatik alt-alta düzür */
@media (max-width: 480px) {
    .calc-form div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important; /* HTML-dəki inline style-ı üstələyir */
        gap: 15px !important;
    }
    .calc-form div[style*="grid"] .input-group label {
        min-height: auto !important;
        display: block !important;
    }
}
