/* Global Styles for CodPlace.com */
/* Market Intelligence Section Styling */
.market-intel-section {
  background: var(--color-bg-medium);
  padding: 3rem 0 2rem 0;
  margin-bottom: 2rem;
  border-radius: 1rem;
  box-shadow: 0 2px 16px rgba(44, 62, 80, 0.08);
}
.market-intel-title {
  font-size: 2.2rem;
  color: var(--color-primary);
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 700;
}
.market-intel-topics {
  list-style: none;
  padding: 0;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.market-intel-topics li {
  background: var(--color-bg-light);
  border-left: 6px solid var(--color-accent);
  padding: 1rem 1.5rem;
  font-size: 1.15rem;
  color: var(--color-text);
  border-radius: 0.5rem;
  box-shadow: 0 1px 6px rgba(44, 62, 80, 0.06);
  transition: box-shadow 0.2s;
}
.market-intel-topics li:hover {
  box-shadow: 0 4px 16px rgba(44, 62, 80, 0.12);
  border-left-color: var(--color-secondary);
}

/* Market Intelligence Card Grid */
.market-intel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.market-intel-card {
  display: block;
  background: var(--color-bg-light);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(44, 62, 80, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-top: 4px solid var(--color-accent);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.market-intel-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(44, 62, 80, 0.15);
}
.market-intel-card .card-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 1rem;
}
.market-intel-card h3 {
  font-size: 1.2rem;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}
.market-intel-card p {
  font-size: 0.95rem;
  color: var(--color-text);
  line-height: 1.6;
  margin: 0;
}

/* Hero Small Variant for Sub-pages */
.hero-small {
  padding: 3rem 0 2rem 0;
  background: linear-gradient(135deg, var(--color-primary) 0%, #1a5a8a 100%);
  color: var(--color-text-light);
  text-align: center;
}
.hero-small h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
.hero-small .tagline {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* 1. Variables & Basic Setup
-------------------------------------------------- */
:root {
  --color-primary: #0d3b66; /* Deep, trustworthy blue */
  --color-secondary: #2a9d8f; /* Professional teal/green */
  --color-accent: #f4a261; /* Soft, warm orange for CTAs */
  --color-text: #333333;
  --color-text-light: #f7f7f7;
  --color-bg-light: #ffffff;
  --color-bg-medium: #f8f9fa;
  --font-family-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-family-ar: "Tahoma", sans-serif;
  --font-family-es: "Roboto", sans-serif;
}

html {
  scroll-behavior: smooth;
  box-sizing: border-box;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

body {
  font-family: var(--font-family-sans);
  margin: 0;
  padding: 0;
  background-color: var(--color-bg-light);
  color: var(--color-text);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html[lang="ar"] body {
  font-family: var(--font-family-ar);
}
html[lang="es"] body {
  font-family: var(--font-family-es);
}

/* 2. Header & Navigation
-------------------------------------------------- */

/* Sale Banner */
.sale-banner {
  background: linear-gradient(
    90deg,
    var(--color-secondary),
    var(--color-primary)
  );
  color: var(--color-text-light);
  text-align: center;
  padding: 0.75rem 1rem;
  position: relative;
  font-size: 0.95rem;
}
.sale-banner p {
  margin: 0;
}
.sale-banner a {
  color: var(--color-accent);
  font-weight: bold;
  text-decoration: underline;
}
.sale-banner a:hover {
  color: #fff;
}
#close-banner {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--color-text-light);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
}
#close-banner:hover {
  opacity: 1;
}
.sale-banner.hidden {
  display: none;
}

.header {
  background-color: var(--color-bg-light);
  padding: 1rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
}

.nav-list {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
}

.nav-list li {
  margin: 0 1rem;
}

.nav-list a {
  text-decoration: none;
  color: var(--color-primary);
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.3s, border-bottom-color 0.3s;
}

.nav-list a:hover,
.nav-list a.active {
  color: var(--color-secondary);
  border-bottom-color: var(--color-secondary);
}

.lang-switcher {
  margin-inline-start: 2rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.lang-switcher a {
  background: none;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  border-radius: 5px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
  min-width: 40px;
  text-align: center;
}

.lang-switcher a:hover {
  background-color: var(--color-primary);
  color: var(--color-bg-light);
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(13, 59, 102, 0.2);
}

.lang-switcher a.active {
  background-color: var(--color-primary);
  color: var(--color-bg-light);
  box-shadow: 0 2px 8px rgba(13, 59, 102, 0.3);
}

/* 3. Main Content & Sections
-------------------------------------------------- */
main {
  display: block; /* For IE11 */
}

.container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 1rem;
}

h1,
h2,
h3,
h4 {
  color: var(--color-primary);
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: 2.8rem;
  margin-bottom: 1rem;
}
h2 {
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  text-align: center;
}
h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}
p {
  margin-bottom: 1rem;
}

/* Hero Section */
.hero {
  background-color: var(--color-primary);
  color: var(--color-text-light);
  text-align: center;
  padding: 6rem 1rem;
}
.hero h1,
.hero p {
  color: var(--color-text-light);
}
.hero p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 1rem auto 2rem;
}
.hero .tagline {
  font-weight: bold;
  color: var(--color-accent);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

/* Call to Action Button */
.cta-button {
  background-color: var(--color-accent);
  color: var(--color-primary);
  text-decoration: none;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.1rem;
  transition: transform 0.3s, box-shadow 0.3s;
  display: inline-block;
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}
.feature-card {
  background: var(--color-bg-light);
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
}
.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}
.feature-card .icon {
  font-size: 3rem;
  color: var(--color-secondary);
  margin-bottom: 1rem;
}

/* Feature Section Styles for Detail Pages */
.feature-section {
  padding: 3rem 0;
  border-bottom: 1px solid #e0e0e0;
}

.feature-section:last-child {
  border-bottom: none;
}

.feature-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.feature-section h2 {
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.feature-section h3 {
  color: var(--color-secondary);
  font-size: 1.3rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.feature-section ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
}

.feature-section li {
  padding-left: 2rem;
  margin-bottom: 0.8rem;
  position: relative;
  line-height: 1.6;
}

.feature-section li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-secondary);
  font-weight: bold;
  font-size: 1.2rem;
}

.section-bg-medium .feature-section {
  background: transparent;
}

.section-bg-medium {
  background-color: var(--color-bg-medium);
  padding: 3rem 5%;
}

/* FAQ Section */
.faq-section {
  padding-bottom: 4rem;
}
.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.faq-item {
  background: var(--color-bg-medium);
  border-radius: 8px;
  padding: 1.5rem;
  border-left: 4px solid var(--color-secondary);
}
.faq-item h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--color-primary);
}
.faq-item p {
  font-size: 0.95rem;
  margin: 0;
  color: var(--color-text);
}
.faq-item a {
  color: var(--color-secondary);
  font-weight: 500;
}

/* 4. Forms
-------------------------------------------------- */
.form-container {
  max-width: 700px;
  margin: 2rem auto;
  padding: 2.5rem;
  background: var(--color-bg-light);
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}
.form-group {
  margin-bottom: 1.5rem;
}
.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--color-primary);
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1rem;
  font-family: inherit;
}
.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

/* 5. Footer
-------------------------------------------------- */
.footer {
  background-color: var(--color-primary);
  color: var(--color-text-light);
  padding: 3rem 5%;
  text-align: center;
}
.footer p {
  margin: 0;
}
.footer .nav-list a {
  color: var(--color-text-light);
}
.footer .nav-list {
  justify-content: center;
  margin-bottom: 1rem;
}

/* 6. Utility & Animations
-------------------------------------------------- */
.text-center {
  text-align: center;
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 7. Responsive Design
-------------------------------------------------- */
@media (max-width: 800px) {
  .header {
    flex-direction: column;
    gap: 1rem;
  }
  .nav {
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 1rem;
  }
  h1 {
    font-size: 2.2rem;
  }
  h2 {
    font-size: 1.8rem;
  }
  .feature-section {
    padding: 2rem 0;
  }
  .feature-section h2 {
    font-size: 1.8rem;
  }
}

@media (max-width: 600px) {
  .nav-list {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  .nav-list li {
    margin: 0;
  }
  .lang-switcher {
    margin-top: 1rem;
    margin-inline-start: 0;
    width: 100%;
    justify-content: center;
  }
  .lang-switcher a {
    padding: 0.5rem 1rem;
    min-width: 50px;
  }
  h1 {
    font-size: 1.8rem;
  }
  h2 {
    font-size: 1.5rem;
  }
  .feature-section li {
    padding-left: 1.8rem;
    font-size: 0.95rem;
  }
  .feature-icon {
    font-size: 3rem;
  }
}

/* Topic Article Styling for Market Intelligence Pages */
.topic-article {
  background: var(--color-bg-light);
}

.article-content {
  padding: 3rem 0;
}

.article-content section {
  margin-bottom: 3rem;
}

.article-content h2 {
  color: var(--color-primary);
  font-size: 2rem;
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 3px solid var(--color-accent);
  padding-bottom: 0.75rem;
}

.article-content h3 {
  color: var(--color-secondary);
  font-size: 1.4rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.article-content h4 {
  color: var(--color-primary);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.article-content p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.article-content ul {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

.article-content li {
  margin-bottom: 0.75rem;
  line-height: 1.7;
  color: var(--color-text);
}

.article-content .market-list {
  list-style: none;
  padding-left: 0;
}

.article-content .market-list li {
  background: var(--color-bg-medium);
  border-left: 4px solid var(--color-accent);
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.article-content .market-list li:hover {
  border-left-color: var(--color-secondary);
  box-shadow: 0 2px 8px rgba(44, 62, 80, 0.1);
  transform: translateX(5px);
}

/* Stat Cards Styling */
.stat-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e8f0f5 100%);
  border-left: 5px solid var(--color-secondary);
  padding: 1.75rem;
  margin: 1.5rem 0;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(42, 157, 143, 0.08);
  transition: all 0.3s ease;
}

.stat-card:hover {
  box-shadow: 0 4px 16px rgba(42, 157, 143, 0.15);
  transform: translateY(-2px);
}

.stat-card h4 {
  margin-top: 0;
}

.stat-card p {
  margin-bottom: 0;
}

/* Highlight Box Styling */
.highlight-box {
  background: linear-gradient(135deg, #fff3cd 0%, #fff8e1 100%);
  border-left: 5px solid var(--color-accent);
  padding: 1.75rem;
  margin: 2rem 0;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(244, 162, 97, 0.1);
}

.highlight-box h3 {
  margin-top: 0;
  color: var(--color-primary);
}

.highlight-box strong {
  color: var(--color-primary);
}

/* Comparison Table Styling */
.comparison-table-container {
  overflow-x: auto;
  margin: 2rem 0;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(44, 62, 80, 0.1);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 0.95rem;
}

.comparison-table thead {
  background: linear-gradient(135deg, var(--color-primary) 0%, #1a5a8a 100%);
  color: white;
}

.comparison-table th {
  padding: 1.25rem 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 3px solid var(--color-primary);
}

.comparison-table tbody tr {
  border-bottom: 1px solid #e0e0e0;
  transition: background-color 0.3s ease;
}

.comparison-table tbody tr:hover {
  background-color: #f8f9fa;
}

.comparison-table tbody tr:last-child {
  border-bottom: none;
}

.comparison-table td {
  padding: 1rem;
  vertical-align: middle;
}

.comparison-table td strong {
  color: var(--color-primary);
  font-weight: 600;
}

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

.region-card {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 0.75rem;
  padding: 2rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(44, 62, 80, 0.06);
}

.region-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 16px rgba(244, 162, 97, 0.15);
  transform: translateY(-2px);
}

.region-card h3 {
  color: var(--color-primary);
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
}

.region-card ul {
  margin: 0;
  padding: 0;
}

.region-card li {
  margin-bottom: 1rem;
  padding-left: 0;
}

.region-card li:last-child {
  margin-bottom: 0;
}

/* Topic Navigation */
.topic-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--color-bg-medium);
}

.topic-nav a {
  display: inline-block;
  padding: 0.875rem 1.5rem;
  background: var(--color-primary);
  color: white;
  text-decoration: none;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.topic-nav a:hover {
  background: var(--color-secondary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(44, 62, 80, 0.2);
}

/* Sources Dropdown Styling */
.sources-dropdown {
  margin-top: 3rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.sources-details {
  background: var(--color-bg-light);
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  border: 1px solid #e0e0e0;
}

.sources-summary {
  padding: 1rem 1.5rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none; /* Remove default triangle */
  background-color: #f8f9fa;
  transition: background-color 0.2s;
}

.sources-summary:hover {
  background-color: #f0f2f5;
}

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

.sources-summary::after {
  content: "+";
  font-size: 1.2rem;
  font-weight: bold;
  transition: transform 0.3s;
}

.sources-details[open] .sources-summary::after {
  transform: rotate(45deg);
}

.sources-list {
  padding: 1.5rem;
  margin: 0;
  list-style: none;
  border-top: 1px solid #e0e0e0;
}

.sources-list li {
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
}

.sources-list li:last-child {
  margin-bottom: 0;
}

.sources-list a {
  color: var(--color-secondary);
  text-decoration: none;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  word-break: break-word;
}

.sources-list a:hover {
  text-decoration: underline;
}

.source-icon {
  min-width: 20px;
}
