/* ==================== ROOT & VARIABLES ==================== */
:root {
  --primary: #F58220;
  --primary-hover: #ffa733;
  --dark: #0f0f0f;
  --light: #ffffff;
  --text-dark: #111;
  --text-light: #ffffff;
  --border-light: #ddd;
  --border-dark: #333;
  --card-bg-light: #ffffff;
  --card-bg-dark: #1c1c1c;
  --transition: 0.4s ease;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* ==================== GLOBAL STYLES ==================== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--dark);
  color: var(--text-light);
  font-family: 'Segoe UI', Tahoma, Geneva, sans-serif;
  margin: 0;
  padding: 0;
  transition: background-color var(--transition), color var(--transition);
}

body.light-mode {
  background-color: var(--light);
  color: var(--text-dark);
}

/* ==================== CONTAINER ==================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==================== HEADER ==================== */
.site-header {
  padding: 1rem 0;
  background-color: inherit;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.logo img {
  height: 48px;
  transition: filter var(--transition);
  display: block;
}

/* ==================== NAVIGATION ==================== */
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin: 0;
  padding: 0;
}

.main-nav a {
  text-decoration: none;
  color: inherit;
  font-weight: 500;
  transition: color var(--transition);
}

.main-nav a:hover,
.main-nav a:focus {
  color: var(--primary);
  outline: none;
}

/* ==================== BUTTONS ==================== */
.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  padding: 0.5rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.icon-btn:hover {
  transform: scale(1.1);
  background-color: rgba(245, 130, 32, 0.1);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ==================== HAMBURGER MENU ==================== */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 21px;
  background: none;
  border: 2px solid var(--primary);
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  z-index: 1100;
}

.hamburger .bar {
  height: 3px;
  width: 100%;
  background-color: var(--primary);
  transition: all 0.3s ease;
  border-radius: 2px;
}

.hamburger.open .bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.open .bar:nth-child(2) {
  opacity: 0;
}

.hamburger.open .bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    right: 1rem;
    background-color: var(--primary);
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.5rem;
    gap: 1rem;
    display: none;
    z-index: 1001;
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 1rem;
  }

  .main-nav a {
    font-size: 1.1rem;
    font-weight: 600;
  }

  .main-nav.open a:hover,
  .main-nav.open a:focus {
    color: #ffffff;
  }
}

/* ==================== HERO SECTION ==================== */
.hero {
  background: url('images/hero-electric-bg_3.jpg') no-repeat center center/cover;
  position: relative;
  padding: 6rem 0;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-overlay {
  background: rgba(0, 0, 0, 0.6);
  padding: 3rem 1.5rem;
  text-align: center;
  transition: background var(--transition);
  border-radius: 8px;
}

body.light-mode .hero-overlay {
  background: rgba(255, 255, 255, 0.85);
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: bold;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.hero .highlight {
  color: var(--primary);
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ==================== BUTTONS ==================== */
.buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: bold;
  text-decoration: none;
  display: inline-block;
  transition: all var(--transition);
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--primary);
  color: #000;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: var(--primary);
  color: #000;
  transform: translateY(-2px);
}

/* ==================== ABOUT SECTION ==================== */
.about-section {
  padding: 4rem 1.5rem;
  background-color: inherit;
  transition: background-color var(--transition);
}

.about-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.about-image img {
  width: 100%;
  max-width: 450px;
  height: auto;
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: block;
}

.about-content h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: inherit;
}

.about-content h3 {
  font-size: 1.3rem;
  margin: 1.5rem 0 1rem;
  color: var(--primary);
}

.about-content p {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1rem;
  opacity: 0.95;
}

.about-benefits {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.about-benefits li {
  padding: 0.75rem 0 0.75rem 1.5rem;
  position: relative;
  font-size: 1rem;
  line-height: 1.6;
}

.about-benefits li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
  font-size: 1.2rem;
}

.about-benefits strong {
  color: var(--primary);
}

@media (max-width: 1024px) {
  .about-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-image img {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .about-section {
    padding: 2rem 1rem;
  }

  .about-content h2 {
    font-size: 1.5rem;
  }

  .about-content h3 {
    font-size: 1.1rem;
  }

  .about-content p,
  .about-benefits li {
    font-size: 0.95rem;
  }
}

/* ==================== SERVICES SECTION ==================== */
.services-section {
  padding: 4rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.services-section h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

.services-section h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* ==================== TABS ==================== */
.tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: 2px solid transparent;
  border-bottom: 3px solid transparent;
  font-weight: bold;
  cursor: pointer;
  color: inherit;
  transition: all 0.3s ease;
  border-radius: 4px;
}

.tab-btn:hover {
  background-color: rgba(245, 130, 32, 0.1);
}

.tab-btn.active {
  border-color: var(--primary);
  color: var(--primary);
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== SERVICE CARDS ==================== */
.service-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.card {
  background-color: var(--card-bg-light);
  color: var(--text-dark);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  height: 100%;
  transition: all 0.3s ease;
}

body.light-mode .card {
  background-color: var(--card-bg-light);
  color: var(--text-dark);
  border-color: var(--border-light);
}

body.dark .card,
body:not(.light-mode) .card {
  background-color: var(--card-bg-dark);
  color: var(--text-light);
  border-color: var(--border-dark);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.card .icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.card h4 {
  margin: 0.5rem 0;
  font-size: 1.1rem;
}

.card p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ==================== RESIDENTIAL REFERENCES SECTION ==================== */
.residential-references-section {
  padding: 4rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.residential-references-section h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  text-align: center;
}

.residential-references-section p {
  text-align: center;
  margin-bottom: 2rem;
  opacity: 0.8;
}

.residential-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.residential-gallery img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.residential-gallery img:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* ==================== REFERENCES SECTION ==================== */
.references-section {
  padding: 4rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.references-section h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

.references-swiper {
  padding-bottom: 3rem;
}

.reference-card {
  background-color: var(--card-bg-light);
  color: var(--text-dark);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

body.light-mode .reference-card {
  background-color: var(--card-bg-light);
  color: var(--text-dark);
  border-color: var(--border-light);
}

body:not(.light-mode) .reference-card {
  background-color: var(--card-bg-dark);
  color: var(--text-light);
  border-color: var(--border-dark);
}

.reference-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.reference-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-bottom: 1px solid inherit;
}

.reference-text {
  padding: 1.2rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.reference-text h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
  font-weight: bold;
}

.reference-text p {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.9;
}

/* ==================== REFERENCES LIST & PAGINATION ==================== */
.references-list {
  margin-bottom: 2rem;
}

.references-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.reference-item {
  background-color: var(--card-bg-light);
  color: var(--text-dark);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  animation: slideIn 0.3s ease;
}

body:not(.light-mode) .reference-item {
  background-color: var(--card-bg-dark);
  color: var(--text-light);
  border-color: var(--border-dark);
}

.reference-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.reference-item .year {
  color: var(--primary);
  font-weight: bold;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.reference-item h4 {
  margin: 0.5rem 0;
  font-size: 1.1rem;
  color: inherit;
}

.reference-item p {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.85;
  line-height: 1.5;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Pagination Controls */
.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.pagination-btn {
  padding: 0.75rem 1.5rem;
  background-color: var(--primary);
  color: #000;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.pagination-btn:hover:not(:disabled) {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-info {
  font-weight: bold;
  font-size: 1.1rem;
  min-width: 100px;
  text-align: center;
}

/* Swiper Pagination */
.swiper-pagination-bullet {
  background-color: var(--primary) !important;
  opacity: 0.4;
}

.swiper-pagination-bullet-active {
  opacity: 1;
}

/* ==================== MODAL ==================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal.show {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  position: relative;
  background-color: var(--card-bg-light);
  color: var(--text-dark);
  border-radius: 1rem;
  padding: 2rem;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  text-align: center;
}

body:not(.light-mode) .modal-content {
  background-color: var(--card-bg-dark);
  color: var(--text-light);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  font-size: 2rem;
  font-weight: bold;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  padding: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.modal-close:hover,
.modal-close:focus {
  background-color: rgba(0, 0, 0, 0.1);
}

.modal-content h2 {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.modal-content p {
  line-height: 1.6;
  margin: 0;
}

.modal-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

@media (max-height: 600px) {
  .modal {
    align-items: flex-start;
    overflow-y: auto;
  }

  .modal-content {
    margin-top: 2rem;
    margin-bottom: 2rem;
  }
}

/* ==================== CONTACT SECTION ==================== */
.contact-section {
  padding: 4rem 1.5rem;
}

.contact-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  align-items: center;
}

.cta-text {
  max-width: 500px;
  flex: 1 1 300px;
}

.cta-text h2 {
  color: var(--primary);
  font-weight: 700;
  font-size: 1.75rem;
  margin-bottom: 1rem;
  margin-top: 0;
}

.cta-text p {
  font-size: 1.1rem;
  line-height: 1.6;
  margin: 0;
  opacity: 0.9;
}

.contact-card {
  padding: 2rem;
  max-width: 400px;
  flex: 1 1 300px;
  text-align: center;
  background-color: var(--card-bg-light);
  color: var(--text-dark);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-sizing: border-box;
  transition: box-shadow 0.3s ease;
}

body:not(.light-mode) .contact-card {
  background-color: var(--card-bg-dark);
  color: var(--text-light);
  border-color: var(--border-dark);
}

.contact-card:hover {
  box-shadow: var(--shadow);
}

.contact-illustration {
  width: 120px;
  height: auto;
  margin: 0 auto 1rem;
  animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% {
    filter: drop-shadow(0 0 10px rgba(245, 130, 32, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 20px rgba(245, 130, 32, 0.8));
  }
}

.contact-card h3 {
  font-size: 1.5rem;
  margin: 0.5rem 0;
}

.job-title {
  font-weight: 400;
  margin-bottom: 1.5rem;
  opacity: 0.8;
}

.contact-details {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact-details li {
  margin: 0.75rem 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.contact-details i {
  width: 20px;
  text-align: center;
  color: var(--primary);
}

.contact-details a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.contact-details a:hover,
.contact-details a:focus {
  color: var(--primary);
  text-decoration: underline;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .services-section,
  .references-section,
  .contact-section {
    padding: 2rem 1rem;
  }

  .service-cards {
    gap: 1rem;
  }

  .reference-card img {
    height: 160px;
  }

  .pagination-controls {
    gap: 1rem;
  }

  .pagination-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  .pagination-info {
    font-size: 1rem;
  }

  .contact-wrapper {
    gap: 1.5rem;
  }

  .tabs {
    gap: 0.5rem;
  }

  .tab-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 640px) {
  .hero h1 {
    font-size: 1.5rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .modal-content {
    padding: 1.5rem;
  }

  .reference-item {
    padding: 1rem;
  }

  .reference-item h4 {
    font-size: 1rem;
  }

  .pagination-controls {
    flex-direction: column;
    gap: 1rem;
  }

  .pagination-btn {
    width: 100%;
  }

  .contact-wrapper {
    flex-direction: column;
  }
}
