/* ============================================
   CCS Website — Shared Styles
   Computer Controlled Solutions Ltd
   ============================================ */

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

:root {
  --bg-dark: #0d1117;
  --bg-card: #161b22;
  --bg-light: #f6f8fa;
  --bg-white: #ffffff;
  --text-primary: #c8d0e0;
  --text-heading: #ffffff;
  --text-dark: #1a1a2e;
  --text-muted: #8b949e;
  --accent-blue: #3a8eef;
  --accent-blue-dark: #2a6fc0;
  --accent-orange: #ef6b3a;
  --accent-green: #3aef7b;
  --border-color: #30363d;
  --nav-height: 70px;
  --max-width: 1200px;
  --transition: 0.3s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Roboto', Arial, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-orange); }

h1, h2, h3, h4 { color: var(--text-heading); line-height: 1.2; }
h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 2rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.4rem; margin-bottom: 0.5rem; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* ---------- Navigation ---------- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo { display: flex; align-items: center; gap: 0.75rem; margin-right: auto; }
.nav-logo img { height: 45px; width: 45px; border-radius: 6px; }
.nav-logo span { font-weight: 700; font-size: 1.1rem; color: var(--text-heading); }

.nav-links { display: flex; gap: 0.25rem; list-style: none; }
.nav-links a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
}
.nav-links a:hover,
.nav-links a.active { background: var(--bg-card); color: var(--accent-blue); }

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

/* ---------- Hero Section ---------- */
.hero {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-top: var(--nav-height);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.35);
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 3rem 1.5rem;
  max-width: 800px;
}

.hero h1 { font-size: 3rem; text-shadow: 0 2px 20px rgba(0,0,0,0.5); }
.hero p { font-size: 1.25rem; color: var(--text-primary); margin-top: 0.75rem; }

.hero .btn { margin-top: 1.5rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: background var(--transition), transform var(--transition);
}
.btn:hover { transform: translateY(-2px); }

.btn-primary { background: var(--accent-blue); color: #fff; }
.btn-primary:hover { background: var(--accent-blue-dark); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--accent-blue);
  border: 2px solid var(--accent-blue);
}
.btn-outline:hover { background: var(--accent-blue); color: #fff; }

.btn-orange { background: var(--accent-orange); color: #fff; }
.btn-orange:hover { background: #d95a2e; color: #fff; }

/* ---------- Sections ---------- */
.section { padding: 5rem 0; }

.section-dark { background: var(--bg-dark); }
.section-card { background: var(--bg-card); }
.section-light { background: var(--bg-light); color: var(--text-dark); }
.section-light h2,
.section-light h3 { color: var(--text-dark); }
.section-light .text-muted { color: #555; }

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}
.section-title h2 { font-size: 2.2rem; }
.section-title p { color: var(--text-muted); max-width: 650px; margin: 0.75rem auto 0; font-size: 1.05rem; }
.section-light .section-title p { color: #555; }

/* ---------- Grid Layouts ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

/* ---------- Industry Cards ---------- */
.industry-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4/3;
  display: flex;
  align-items: flex-end;
  transition: transform var(--transition), box-shadow var(--transition);
}
.industry-card:hover { transform: translateY(-6px); box-shadow: 0 12px 40px rgba(58,142,239,0.2); }

.industry-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}
.industry-card:hover img { transform: scale(1.05); }

.industry-card .card-label {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 1rem 1.25rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Content Cards ---------- */
.content-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  transition: border-color var(--transition), transform var(--transition);
}
.content-card:hover { border-color: var(--accent-blue); transform: translateY(-4px); }

.content-card h3 { margin-bottom: 0.75rem; }

/* ---------- Product Cards ---------- */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
}
.product-card:hover { border-color: var(--accent-blue); transform: translateY(-4px); }

.product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.product-card .card-body { padding: 1.5rem; }
.product-card h3 { margin-bottom: 0.5rem; }

/* ---------- Two-Column Feature ---------- */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.feature-row.reverse { direction: rtl; }
.feature-row.reverse > * { direction: ltr; }

.feature-text h2 { margin-bottom: 1rem; }
.feature-text p { margin-bottom: 1rem; }

.feature-image img { border-radius: 12px; }

/* ---------- Approach Tabs ---------- */
.tabs { display: flex; gap: 0.5rem; margin-bottom: 2rem; flex-wrap: wrap; }
.tab-btn {
  padding: 0.6rem 1.5rem;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all var(--transition);
}
.tab-btn.active,
.tab-btn:hover {
  border-color: var(--accent-blue);
  background: var(--accent-blue);
  color: #fff;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Testimonials ---------- */
.testimonial-carousel {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  min-height: 200px;
}

.testimonial-slide {
  display: none;
  animation: fadeIn 0.5s ease;
}
.testimonial-slide.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.testimonial-slide blockquote {
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}
.testimonial-slide blockquote::before { content: "\201C"; font-size: 3rem; color: var(--accent-blue); display: block; line-height: 1; margin-bottom: 0.25rem; }

.testimonial-slide .attribution {
  font-weight: 600;
  color: var(--accent-blue);
}
.testimonial-slide .attribution span {
  display: block;
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}
.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: var(--border-color);
  cursor: pointer;
  transition: background var(--transition);
}
.carousel-dot.active { background: var(--accent-blue); }

/* ---------- Video Grid ---------- */
.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

.video-card {
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}
.video-card iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  display: block;
}
.video-card .video-title {
  padding: 1rem;
  font-weight: 600;
  font-size: 0.9rem;
}

/* ---------- Credentials Bar ---------- */
.credentials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
  padding: 0.5rem 0;
}
.credentials img { height: 45px; width: auto; }

/* ---------- Case Study List ---------- */
.case-study-list { list-style: none; }
.case-study-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.case-study-list li::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--accent-blue);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---------- Contact Form ---------- */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 500px;
}
.contact-form label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-heading);
}
.contact-form input,
.contact-form textarea {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color var(--transition);
}
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--accent-blue); }
.contact-form textarea { min-height: 150px; resize: vertical; }

/* ---------- Contact Info ---------- */
.contact-info { list-style: none; }
.contact-info li { padding: 0.75rem 0; display: flex; gap: 0.75rem; align-items: flex-start; }
.contact-info .label { font-weight: 600; color: var(--text-heading); min-width: 80px; }

/* ---------- Map ---------- */
.map-embed {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.map-embed iframe { width: 100%; height: 350px; border: none; display: block; }

/* ---------- News Cards ---------- */
.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  transition: border-color var(--transition);
}
.news-card:hover { border-color: var(--accent-blue); }
.news-card .news-date { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 0.5rem; }
.news-card h3 { margin-bottom: 0.75rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand p { color: var(--text-muted); margin-top: 0.5rem; font-size: 0.9rem; }
.footer-links h4 { margin-bottom: 1rem; font-size: 0.95rem; }
.footer-links ul { list-style: none; }
.footer-links a { color: var(--text-muted); font-size: 0.9rem; display: block; padding: 0.25rem 0; }
.footer-links a:hover { color: var(--accent-blue); }

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- CTA Banner ---------- */
.cta-banner {
  text-align: center;
  padding: 4rem 1.5rem;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-dark));
}
.cta-banner h2 { margin-bottom: 0.75rem; }
.cta-banner p { color: rgba(255,255,255,0.85); margin-bottom: 1.5rem; font-size: 1.1rem; }
.cta-banner .btn { background: #fff; color: var(--accent-blue); font-weight: 700; }
.cta-banner .btn:hover { background: rgba(255,255,255,0.9); }

/* ---------- Demo Corner Triangle ---------- */
.demo-corner {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 10;
  display: block;
  width: 100px;
  height: 100px;
  text-decoration: none !important;
  cursor: pointer;
}
.demo-corner::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 100px 0 0 100px;
  border-color: #e53e3e transparent transparent transparent;
  transition: border-color 0.3s ease;
}
.demo-corner:hover::before {
  border-color: #c53030 transparent transparent transparent;
}
.demo-corner span {
  position: absolute;
  top: 15px;
  right: 8px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
  transform: rotate(45deg);
  text-decoration: none;
  padding: 4px 8px;
  z-index: 1;
}

/* ---------- Demo Modal ---------- */
.demo-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}
.demo-overlay.active { display: flex; }

.demo-modal {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 90vw;
  height: 85vh;
  max-width: 1200px;
  position: relative;
  overflow: hidden;
}
.demo-modal iframe { width: 100%; height: 100%; border: none; }

.demo-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  color: var(--text-heading);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.demo-close:hover { background: var(--accent-blue); }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .video-grid { grid-template-columns: 1fr 1fr; }
  .feature-row { grid-template-columns: 1fr; }
  .feature-row.reverse { direction: ltr; }
  .footer-grid { grid-template-columns: 1fr; }
  h1 { font-size: 2rem; }
  .hero h1 { font-size: 2.2rem; }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: 1rem;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .nav-logo span { font-size: 0.85rem; }
  .nav-inner { padding-right: 5rem; }
  .demo-corner { width: 80px; height: 80px; }
  .demo-corner::before { border-width: 80px 0 0 80px; }
  .demo-corner span { top: 8px; right: 4px; font-size: 0.6rem; }

  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .grid-3, .video-grid { grid-template-columns: 1fr; }
  .hero { min-height: 350px; }
  .hero h1 { font-size: 1.8rem; }
  .section { padding: 3rem 0; }
  .tabs { justify-content: center; }
}
