/* ================================================
   ARS Elektrik Tesisat - Responsive Styles
   Mobile-First Responsive Design
   ================================================ */

/* ================================================
   Tablet Landscape (max-width: 1024px)
   ================================================ */
@media (max-width: 1024px) {
  :root {
    --section-padding: 60px;
  }

  .container {
    padding: 0 40px;
  }

  .navbar-menu {
    gap: 20px;
  }

  .services-grid,
  .projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Proje/Hizmet detay sayfaları - Sidebar daralt */
  [style*="grid-template-columns: 1fr 350px"] {
    grid-template-columns: 1fr 280px !important;
    gap: 30px !important;
  }
}

/* ================================================
   Tablet Portrait (max-width: 768px)
   ================================================ */
@media (max-width: 768px) {
  :root {
    --section-padding: 50px;
  }

  .container {
    padding: 0 30px;
  }

  /* Navigation */
  .navbar-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: rgba(10, 14, 39, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 40px;
    gap: 30px;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
  }

  .navbar-menu.active {
    right: 0;
  }

  .navbar-menu li a {
    font-size: 1.2rem;
  }

  .navbar-toggle {
    display: flex;
  }

  /* Hero */
  .hero h1 {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .hero p {
    font-size: clamp(1rem, 3vw, 1.2rem);
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .hero-buttons .btn {
    width: 100%;
    max-width: 300px;
  }

  /* Typography */
  h1 {
    font-size: clamp(2rem, 6vw, 3rem);
  }

  h2 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
  }

  h3 {
    font-size: clamp(1.3rem, 4vw, 1.8rem);
  }

  p {
    font-size: 1rem;
  }

  /* Section Title */
  .section-title h2::after {
    width: 60px;
  }

  /* Cards */
  .card {
    padding: 30px;
  }

  .card-icon {
    font-size: 2.5rem;
  }

  /* Services */
  .services-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Hakkımızda sayfası için 2 sütunlu grid düzeni mobilde tek sütun */
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Güneş Enerjisi kartı mobilde responsive */
  [style*="max-width: 800px"],
  [style*="max-width: 900px"] {
    max-width: 100% !important;
  }

  /* Proje ve Hizmet detay sayfaları - Ana içerik + Sidebar layout */
  [style*="grid-template-columns: 1fr 350px"] {
    grid-template-columns: 1fr !important;
    gap: 30px !important;
  }

  /* Proje detay kartları (Konum, Alan, Süre, Durum) */
  [style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  /* Proje görselleri grid */
  [style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  /* Gap 60px olan grid'ler mobilde azalsın */
  [style*="gap: 60px"] {
    gap: 30px !important;
  }

  /* Sidebar aside mobilde tam genişlik */
  aside {
    width: 100%;
  }

  /* Detay sayfa resimleri mobilde yükseklik */
  [style*="height: 400px"] {
    height: 250px !important;
  }

  /* Detay sayfa article başlık boyutu */
  article h2 {
    font-size: 1.5rem !important;
  }

  /* CTA butonları mobilde alt alta */
  article [style*="display: flex"][style*="justify-content: center"] {
    flex-direction: column !important;
    align-items: center !important;
  }

  article [style*="display: flex"][style*="justify-content: center"] .btn {
    width: 100% !important;
    max-width: 300px;
    text-align: center;
  }

  /* Stats */
  .stats {
    padding: 60px 0;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .stat-number {
    font-size: 3rem;
  }

  .stat-label {
    font-size: 1rem;
  }

  /* Projects */
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .project-card {
    height: 350px;
  }

  .project-overlay {
    padding: 25px;
  }

  /* Footer */
  .footer {
    padding: 50px 0 20px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-social {
    justify-content: center;
  }

  /* Back to Top */
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }
}

/* ================================================
   Mobile (max-width: 480px)
   ================================================ */
@media (max-width: 480px) {
  :root {
    --section-padding: 50px;
  }

  /* Container */
  .container {
    padding: 0 20px;
  }

  /* Navigation */
  .navbar {
    padding: 15px 0;
  }

  .navbar-logo img {
    height: 40px;
  }

  .navbar.scrolled .navbar-logo img {
    height: 35px;
  }

  .navbar-menu {
    width: 85%;
    padding: 30px;
    gap: 25px;
  }

  .navbar-menu li a {
    font-size: 1.1rem;
  }

  .navbar-toggle span {
    width: 25px;
    height: 2.5px;
  }

  /* Hero */
  .hero {
    min-height: 80vh;
  }

  .hero h1 {
    font-size: clamp(1.8rem, 8vw, 2.5rem);
    margin-bottom: 15px;
  }

  .hero p {
    font-size: clamp(0.95rem, 3vw, 1.1rem);
    margin-bottom: 30px;
  }

  .hero-buttons {
    gap: 15px;
  }

  .hero-buttons .btn {
    padding: 12px 30px;
    font-size: 0.9rem;
  }

  /* Typography */
  h1 {
    font-size: clamp(1.8rem, 7vw, 2.5rem);
  }

  h2 {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }

  h3 {
    font-size: clamp(1.2rem, 5vw, 1.5rem);
  }

  p {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  /* Section */
  .section-title {
    margin-bottom: 40px;
  }

  .section-title h2::after {
    width: 50px;
    height: 3px;
  }

  /* Buttons */
  .btn {
    padding: 12px 30px;
    font-size: 0.9rem;
  }

  /* Cards */
  .card {
    padding: 25px;
    border-radius: 15px;
  }

  .card-icon {
    font-size: 2.2rem;
    margin-bottom: 15px;
  }

  .card h3 {
    margin-bottom: 12px;
  }

  .card p {
    font-size: 0.95rem;
  }

  /* Proje detay kartları mobilde 2x2 grid */
  [style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  /* Proje görselleri mobilde tek sütun */
  [style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* Detay sayfası gap'i azalt */
  [style*="grid-template-columns: 1fr 350px"] {
    gap: 20px !important;
  }

  /* Proje/hizmet sayfası resimleri mobilde yükseklik ayarı */
  [style*="height: 400px"] {
    height: 220px !important;
  }

  [style*="height: 200px"] {
    height: 160px !important;
  }

  [style*="height: 180px"] {
    height: 150px !important;
  }

  /* Stats */
  .stats {
    padding: 50px 0;
  }

  .stat-item {
    padding: 20px;
  }

  .stat-number {
    font-size: 2.5rem;
  }

  .stat-label {
    font-size: 0.9rem;
    letter-spacing: 1px;
  }

  /* Projects */
  .project-card {
    height: 300px;
    border-radius: 15px;
  }

  .project-overlay {
    padding: 20px;
  }

  .project-category {
    font-size: 0.8rem;
    margin-bottom: 8px;
  }

  .project-title {
    font-size: 1.3rem;
    margin-bottom: 8px;
  }

  .project-description {
    font-size: 0.9rem;
  }

  /* Footer */
  .footer {
    padding: 40px 0 20px;
  }

  .footer-section h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
  }

  .footer-section ul li {
    margin-bottom: 8px;
    font-size: 0.95rem;
  }

  .footer-social a {
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
  }

  .footer-bottom {
    font-size: 0.9rem;
    padding-top: 20px;
  }

  /* Back to Top */
  .back-to-top {
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}

/* ================================================
   Small Mobile (max-width: 375px)
   ================================================ */
@media (max-width: 375px) {
  :root {
    --section-padding: 40px;
  }

  .container {
    padding: 0 12px;
  }

  .navbar-logo img {
    height: 35px;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 0.9rem;
  }

  .btn {
    padding: 10px 25px;
    font-size: 0.85rem;
  }

  .card {
    padding: 20px;
  }

  .stat-number {
    font-size: 2.2rem;
  }

  .project-card {
    height: 280px;
  }
}

/* ================================================
   Landscape Mode for Mobile Devices
   ================================================ */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: 100px 0 60px;
  }

  .navbar-menu {
    height: 100vh;
    overflow-y: auto;
    padding-top: 80px;
  }

  .section {
    padding: 50px 0;
  }
}

/* ================================================
   High Resolution Displays
   ================================================ */
@media (min-width: 1920px) {
  .container {
    max-width: 1200px;
  }

  h1 {
    font-size: 3.5rem;
  }

  h2 {
    font-size: 2.8rem;
  }

  .services-grid,
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ================================================
   Print Styles
   ================================================ */
@media print {
  .navbar,
  .back-to-top,
  .loader,
  #particles-js {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .section {
    page-break-inside: avoid;
  }
}

/* ================================================
   Reduced Motion
   ================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ================================================
   Dark Mode Support (if OS prefers dark)
   ================================================ */
@media (prefers-color-scheme: dark) {
  /* Already dark by default, but can adjust if needed */
  :root {
    --dark-bg: #050811;
    --card-bg: #0F1425;
  }
}
