/*
 * Main stylesheet for the Tamir Ul‑Ardh Al‑Taiba website.
 * This file defines a light/dark theme using CSS variables, responsive
 * layouts for different sections, and simple animation helpers.
 */

/* Root variables for light theme */
:root {
  --primary-color: #1f5481; /* deep blue matching the company brand */
  --secondary-color: #00a2cf; /* bright accent colour */
  --background-color: #ffffff;
  --text-color: #333333;
  --section-bg: #f5f9fc;
  --card-bg: #ffffff;
  --border-radius: 8px;
  --transition-speed: 0.3s;
}

/* Dark theme overrides */
body.dark {
  --background-color: #0d253f;
  --text-color: #e0e8f0;
  --section-bg: #102f55;
  --card-bg: #173b60;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  transition: background-color var(--transition-speed) ease,
              color var(--transition-speed) ease;
  scroll-behavior: smooth;
}

/* Container utility */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--primary-color);
  color: #fff;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}
.logo {
  font-weight: 700;
  font-size: 1.2rem;
  white-space: nowrap;
}

/* Navigation */
.nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}
.nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding: 0.25rem 0;
}
.nav a.active,
.nav a:hover {
  border-bottom: 2px solid var(--secondary-color);
}

/* Header controls */
.nav-controls button {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.25rem;
  margin-left: 1rem;
  cursor: pointer;
  transition: color var(--transition-speed);
}
.nav-controls button:hover {
  color: var(--secondary-color);
}

/* Hero Section & Slider */
.hero {
  margin-top: 76px; /* height of fixed header */
  position: relative;
  overflow: hidden;
}
.slider {
  position: relative;
  height: 75vh;
  width: 100%;
}
.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease;
}
.slide.active {
  opacity: 1;
}
.slide .overlay {
  position: absolute;
  bottom: 20%;
  left: 10%;
  max-width: 50%;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.slide .overlay h2 {
  font-size: 2rem;
  margin: 0 0 0.5rem;
}
.slide .overlay p {
  font-size: 1rem;
  line-height: 1.5;
}
.slider-nav {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 0.5rem;
}
.slider-nav button {
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: #fff;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.3s;
}
.slider-nav button:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Generic section styling */
.section {
  padding: 4rem 0;
  background: var(--background-color);
}
.section:nth-of-type(even) {
  background: var(--section-bg);
}
.section-title {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2rem;
  color: var(--primary-color);
}
.section-text {
  max-width: 800px;
  margin: 0 auto 3rem;
  font-size: 1rem;
  line-height: 1.6;
  text-align: center;
}

/* Services */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}
.service-card {
  background: var(--card-bg);
  padding: 2rem 1.5rem;
  border-radius: var(--border-radius);
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: transform var(--transition-speed);
}
.service-card:hover {
  transform: translateY(-4px);
}
.service-card i {
  font-size: 2rem;
  color: var(--secondary-color);
  margin-bottom: 1rem;
}
.service-card h3 {
  margin: 0.5rem 0;
  color: var(--primary-color);
  font-size: 1.25rem;
}
.service-card p {
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Projects */
.projects-filter {
  text-align: center;
  margin-bottom: 2rem;
}
.projects-filter .filter-btn {
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  margin: 0 0.25rem;
  border-radius: 20px;
  cursor: pointer;
  transition: background var(--transition-speed);
}
.projects-filter .filter-btn.active,
.projects-filter .filter-btn:hover {
  background: var(--secondary-color);
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.project-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: transform var(--transition-speed);
}
.project-card:hover {
  transform: translateY(-4px);
}
.project-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.project-card .content {
  padding: 1rem;
}
.project-card h3 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
  color: var(--primary-color);
}
.project-card p {
  font-size: 0.9rem;
  line-height: 1.5;
  max-height: 4.5em; /* limit text height to prevent overflow */
  overflow: hidden;
}

/* Stats */
.stats-container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 2rem;
}
.stat {
  text-align: center;
  flex: 1 1 150px;
}
.stat-number {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin: 0;
}
.stat p {
  margin: 0.5rem 0 0;
  font-size: 1rem;
}

/* Footer */
.footer {
  background: var(--primary-color);
  color: #fff;
  padding: 1rem 0;
  text-align: center;
}

/* WhatsApp floating buttons */
.whatsapp {
  position: fixed;
  bottom: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 1000;
}
.whatsapp a {
  width: 45px;
  height: 45px;
  background: #25d366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: transform var(--transition-speed);
}
.whatsapp a:hover {
  transform: scale(1.05);
}

/* Page hero banner */
.page-hero {
  margin-top: 76px;
  height: 40vh;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-hero .overlay {
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  color: #fff;
}
.page-hero h1 {
  font-size: 2.5rem;
  margin: 0;
}

/* About page specific */
.about-page .about-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}
.about-block h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}
.about-block p {
  font-size: 0.95rem;
  line-height: 1.6;
}
.values-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.values-list li {
  margin: 0.25rem 0;
  padding-left: 1.2rem;
  position: relative;
}
.values-list li::before {
  content: '\f058'; /* Font Awesome check-circle icon */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  left: 0;
  top: 0;
  color: var(--secondary-color);
}

/* Achievements page */
.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.achievement-item {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.achievement-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.achievement-content {
  padding: 1rem 1.5rem 2rem;
}
.achievement-content h3 {
  margin-top: 0;
  color: var(--primary-color);
  font-size: 1.2rem;
}
.achievement-content p {
  font-size: 0.95rem;
  line-height: 1.6;
}
@media (min-width: 768px) {
  .achievement-item {
    flex-direction: row;
  }
  .achievement-image, .achievement-content {
    flex: 1;
  }
  .achievement-image img {
    height: 100%;
  }
}

/* Media page */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.media-thumb {
  width: 100%;
  height: 150px;
  object-fit: cover;
  cursor: pointer;
  border-radius: var(--border-radius);
  transition: transform var(--transition-speed);
}
.media-thumb:hover {
  transform: scale(1.05);
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.lightbox.hidden {
  display: none;
}
.lightbox img {
  max-width: 90%;
  max-height: 80%;
  border-radius: var(--border-radius);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}

/* Contact page */
.contact-info-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.contact-info p {
  margin: 0.5rem 0;
  font-size: 1rem;
}
.contact-form {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  flex: 1;
}
.contact-form .form-group {
  margin-bottom: 1rem;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ccc;
  border-radius: var(--border-radius);
  font-size: 1rem;
  color: var(--text-color);
  background: var(--background-color);
  transition: border-color var(--transition-speed);
}
.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #888;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
}
.contact-form .btn {
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1rem;
  transition: background var(--transition-speed);
}
.contact-form .btn:hover {
  background: var(--secondary-color);
}
@media (min-width: 768px) {
  .contact-info-form {
    flex-direction: row;
    align-items: flex-start;
  }
  .contact-info {
    flex: 1;
    padding-right: 2rem;
  }
}