/* Tradecon BD - Design System - White & Brown Theme */

:root {
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8F5F2;
  --bg-card: #FFFFFF;
  --text-primary: #3E2723;
  --text-secondary: #5D4037;
  --text-muted: #8D6E63;
  --border: #E0D5CE;
  --border-subtle: #F0EAE6;
  --accent: #6D4C41;
  --accent-hover: #4E342E;
  --accent-light: #EFEBE9;
  --button-bg: #6D4C41;
  --button-text: #FFFFFF;
  --header-bg: #FFFFFF;
  --header-text: #3E2723;
  --footer-bg: #3E2723;
  --footer-text: #F5F0EC;
  --shadow: 0 4px 20px rgba(62, 39, 35, 0.08);
  --shadow-hover: 0 8px 30px rgba(62, 39, 35, 0.12);
  --radius: 8px;
  --transition: all 0.3s ease;
  /* Legacy aliases for compatibility */
  --navy: #3E2723;
  --green: #6D4C41;
  --amber: #A1887F;
  --teal: #8D6E63;
  --offwhite: #F8F5F2;
  --lightgrey: #E0D5CE;
  --slate: #3E2723;
  --midgrey: #8D6E63;
  --steel: #A1887F;
  --white: #FFFFFF;
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: 1.5rem; }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.25rem; }

p { margin-bottom: 1rem; }

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

img { max-width: 100%; height: auto; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section-alt {
  background: var(--bg-secondary);
}

.btn {
  display: inline-block;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-align: center;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--button-bg);
  color: var(--button-text);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: transparent;
  color: var(--button-text);
  border: 2px solid var(--button-text);
}

.btn-secondary:hover {
  background: var(--button-text);
  color: var(--text-primary);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border-dark, #D0CDC7);
}

.btn-outline:hover {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.btn-green {
  background: var(--accent);
  color: var(--bg-primary);
}

.btn-green:hover {
  background: var(--accent-hover);
}

/* Header */
header {
  background: var(--header-bg);
  color: var(--header-text);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 0 var(--border);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  position: relative; /* containing block for mobile dropdown */
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--header-text);
}

.logo span { color: var(--amber); }

nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  flex-wrap: nowrap;
}

nav a {
  color: var(--header-text);
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
}

nav a:hover, nav a.active {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--header-text);
  font-size: 1.5rem;
  cursor: pointer;
}

.lang-toggle {
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  margin-left: 1rem;
}

/* Hero */
.hero {
  background: linear-gradient(rgba(62, 39, 35, 0.82), rgba(62, 39, 35, 0.68)), url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="%236D4C41" stroke-width="0.5" opacity="0.3"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  background-size: cover;
  color: #FFFFFF;
  padding: 8rem 0 6rem;
  text-align: center;
  position: relative;
}

.hero h1 {
  color: var(--white);
  margin-bottom: 1.5rem;
}

.hero p {
  font-size: 1.25rem;
  max-width: 700px;
  margin: 0 auto 2rem;
  opacity: 0.95;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid var(--border);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.card h3 {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.division-card {
  text-align: center;
  padding: 2.5rem;
}

.division-card.renewable { border-top: 4px solid var(--accent); }
.division-card.global { border-top: 4px solid var(--steel); }

/* Key figures */
.key-figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  text-align: center;
  margin: 3rem 0;
}

.figure {
  background: var(--bg-card);
  padding: 2rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.figure .number {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--amber);
  display: block;
}

.figure .label {
  color: var(--midgrey);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Process steps */
.process-steps {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 2rem 0;
  position: relative;
}

.process-step {
  flex: 1;
  min-width: 140px;
  text-align: center;
  position: relative;
}

.process-step::after {
  content: '';
  position: absolute;
  top: 30px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--lightgrey);
  z-index: -1;
}

.process-step:last-child::after { display: none; }

.step-number {
  width: 60px;
  height: 60px;
  background: var(--accent);
  color: var(--bg-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* Spec table */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.spec-table th, .spec-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--lightgrey);
}

.spec-table th {
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 600;
}

.spec-table tr:nth-child(even) {
  background: var(--bg-secondary);
}

.spec-table .mono {
  font-family: var(--font-mono);
  font-weight: 500;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: var(--transition);
  background: var(--bg-card);
  color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(44, 74, 62, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Enhanced Solar Calculator */
.calculator {
  background: var(--bg-card);
  padding: 2.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 720px;
  margin: 2rem auto;
  border: 1px solid var(--border);
}

.calc-inputs {
  display: grid;
  gap: 1.5rem;
}

.slider-group {
  margin-bottom: 0.5rem;
}

.slider-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.slider-group .value-display {
  font-family: var(--font-mono);
  color: var(--amber);
  font-size: 1.1rem;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--lightgrey);
  outline: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg-primary);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.calc-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.result-card {
  background: var(--bg-secondary);
  padding: 1.25rem;
  border-radius: var(--radius);
  text-align: center;
  border-left: 4px solid var(--accent);
}

.result-card.amber { border-left-color: var(--amber); }
.result-card.teal { border-left-color: var(--teal); }

.result-card .label {
  font-size: 0.85rem;
  color: var(--midgrey);
  margin-bottom: 0.4rem;
}

.result-card .value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-primary);
}

.assumptions {
  font-size: 0.85rem;
  color: var(--midgrey);
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--lightgrey);
  line-height: 1.5;
}

.calc-result {
  display: block !important;
}

/* Project filter */
.filter-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  justify-content: center;
}

.filter-btn {
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn.active, .filter-btn:hover {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid var(--border);
}

.project-card:hover { transform: translateY(-3px); }

.project-card .placeholder-img {
  height: 200px;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-primary);
  font-weight: 600;
}

.project-card .content { padding: 1.5rem; }

/* Footer */
footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

footer h4 { color: var(--amber); margin-bottom: 1rem; }

footer a { color: #D0D0D0; }
footer a:hover { color: var(--amber); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: #A0A0A0;
}

/* WhatsApp float */
.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #25D366;
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
  z-index: 999;
  transition: var(--transition);
}

.whatsapp-float:hover {
  transform: scale(1.1);
  color: white;
}

/* Cookie notice */
.cookie-notice {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 1rem;
  display: none;
  z-index: 1001;
  text-align: center;
}

.cookie-notice.show { display: block; }

.cookie-notice button {
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  padding: 0.5rem 1rem;
  margin-left: 1rem;
  border-radius: 4px;
  cursor: pointer;
}

/* FAQ */
.faq-item {
  border-bottom: 1px solid var(--lightgrey);
  margin-bottom: 0.5rem;
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 1rem 0;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.05rem;
  display: flex;
  justify-content: space-between;
}

.faq-answer {
  display: none;
  padding: 0 0 1rem;
  color: var(--text-secondary);
}

.faq-item.open .faq-answer { display: block; }

/* Responsive — enhanced for all devices, especially tablets */
@media (max-width: 1280px) {
  .nav-container { padding: 0.75rem 1.25rem; }
  .container { padding: 0 1.25rem; }
  .card-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
  .photo-strip { grid-template-columns: repeat(2, 1fr); }
  .key-figures { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .section { padding: 4rem 0; }
  .hero { padding: 6rem 0 4rem; }

  /* Use hamburger on tablets (including iPad landscape) for clean, balanced nav */
  nav ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--header-bg);
    flex-direction: column;
    padding: 0.5rem 1rem 1rem;
    gap: 0;
    z-index: 1001;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    max-height: 80vh;
    overflow-y: auto;
    border-bottom: 1px solid var(--border);
  }

  nav ul.show { display: flex; }
  nav ul li { padding: 0.85rem 0; border-bottom: 1px solid var(--border); }
  nav ul li:last-child { border-bottom: none; }
  nav a { font-size: 1.05rem; display: block; color: var(--header-text); white-space: nowrap; }

  .nav-toggle {
    display: block;
    font-size: 1.75rem;
    padding: 0.4rem 0.6rem;
    line-height: 1;
    color: var(--header-text);
  }

  .lang-toggle {
    margin-left: 0.5rem;
    padding: 0.45rem 0.7rem;
    font-size: 0.8rem;
  }

  .logo img { height: 36px; }
}

@media (max-width: 768px) {
  /* Mobile layout adjustments */
  .form-row { grid-template-columns: 1fr; }
  .process-steps { flex-direction: column; gap: 1.5rem; }
  .process-step::after { display: none; }
  .process-step { min-width: 0; }

  .hero { padding: 4.5rem 0 2.5rem; }
  .hero p { font-size: 1.1rem; }
  .section { padding: 2.75rem 0; }

  .card-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .key-figures { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; }
  .figure { padding: 1.5rem 0.75rem; }
  .figure .number { font-size: 2rem; }

  .calculator { padding: 1.5rem; margin: 1rem auto; }
  .calc-results-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

  .photo-strip { grid-template-columns: 1fr; gap: 1rem; }
  .photo-strip img { height: 200px; }
  .card-photo { height: 160px; }

  /* Tables */
  .spec-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.9rem;
  }
  .spec-table th, .spec-table td { padding: 0.6rem 0.75rem; white-space: nowrap; }

  /* Buttons & touch targets */
  .btn { padding: 0.9rem 1.5rem; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; }
  .filter-buttons { gap: 0.4rem; }
  .filter-btn { padding: 0.55rem 1rem; min-height: 40px; }

  /* WhatsApp float & cookie */
  .whatsapp-float { width: 54px; height: 54px; bottom: 16px; right: 16px; }
  .cookie-notice { padding: 0.85rem; font-size: 0.9rem; }
  .cookie-notice button { margin: 0.5rem 0 0 0.5rem; display: inline-block; }

  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (max-width: 480px) {
  body { font-size: 15px; }
  .nav-container { padding: 0.6rem 0.75rem; }
  .logo img { height: 32px; }
  .hero { padding: 3.5rem 0 2rem; }
  .hero h1 { font-size: clamp(1.6rem, 7vw, 2.2rem); }
  .hero p { font-size: 1rem; }
  .container { padding: 0 1rem; }
  .section { padding: 2.25rem 0; }
  .card { padding: 1.5rem; }
  .division-card { padding: 1.75rem; }
  .figure .number { font-size: 1.75rem; }
  .result-card .value { font-size: 1.35rem; }
  .whatsapp-float { width: 50px; height: 50px; bottom: 12px; right: 12px; }
}

/* Prevent accidental horizontal overflow on small devices */
html, body { max-width: 100%; overflow-x: hidden; }
img, video, svg { max-width: 100%; height: auto; }

/* Technical pattern for navy sections */
.pattern-bg {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><path d="M0 20h40M20 0v40" stroke="%23ffffff" stroke-width="0.5" opacity="0.05"/></svg>');
}

/* Icons as inline SVGs will be used in HTML */

.placeholder {
  background: var(--lightgrey);
  border: 2px dashed var(--midgrey);
  padding: 2rem;
  text-align: center;
  color: var(--midgrey);
  border-radius: var(--radius);
  margin: 1rem 0;
  font-style: italic;
}

.logo img { display: block; height: 42px; width: auto; }

/* Bengali mode */
html[lang="bn"] body,
html[lang="bn"] h1, html[lang="bn"] h2, html[lang="bn"] h3, html[lang="bn"] h4,
html[lang="bn"] .btn, html[lang="bn"] nav a, html[lang="bn"] .lang-toggle {
  font-family: 'Noto Sans Bengali', 'Kalpurush', 'Nirmala UI', sans-serif;
}
html[lang="bn"] body { line-height: 1.8; }
html[lang="bn"] h1, html[lang="bn"] h2, html[lang="bn"] h3 { line-height: 1.4; }

/* Photos & diagrams */
.card-photo { display:block; width:100%; height:190px; object-fit:cover; border-radius:6px; margin-bottom:1rem; }
.photo-strip { display:grid; grid-template-columns:repeat(auto-fit, minmax(250px, 1fr)); gap:1.25rem; margin-top:2rem; }
.photo-strip figure { margin:0; }
.photo-strip img { display:block; width:100%; height:230px; object-fit:cover; border-radius:8px; box-shadow:0 4px 14px rgba(26,26,26,0.1); }
.photo-strip figcaption { margin-top:0.6rem; font-size:0.9rem; color:var(--text-secondary); text-align:center; }
.diagram { margin-top:1.5rem; padding:1.25rem; background:var(--bg-card); border:1px solid var(--border); border-radius:10px; box-shadow:var(--shadow); }
.diagram svg { display:block; width:100%; height:auto; }
.diagram svg text { font-family:'Montserrat','Noto Sans Bengali',Arial,sans-serif; font-weight:600; fill:#fff; text-anchor:middle; }
.diagram .note { margin-top:0.75rem; font-size:0.9rem; color:var(--text-secondary); text-align:center; }
.diagram { overflow-x:auto; }
.diagram svg { min-width:640px; }
