/* Web Development Service Page Styles - Mobile Safari Fixes */
/* Preserving all original desktop styles while adding mobile responsiveness */

/* Base Styles */
:root {
  --neon-purple: #8a2be2;
  --electric-blue: #00d1ff;
  --star-white: #ffffff;
  --metallic: #b8c2d9;
  --space-black: #0a0a16;
  --glow: 0 0 20px rgba(0, 209, 255, 0.7);
}

/* Safari-specific fixes */
@supports (-webkit-touch-callout: none) {
  html {
    -webkit-text-size-adjust: 100%;
  }
  body {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
}

/* Service Hero - Mobile First */
.service-hero {
  padding: 12rem 5% 5rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

/* iOS Safari specific viewport fixes */
@supports (-webkit-touch-callout: none) {
  .service-hero {
    min-height: -webkit-fill-available;
    height: -webkit-fill-available;
    padding-top: calc(12rem + env(safe-area-inset-top));
  }
}

/* Hero Content - Preserving original desktop layout */
.hero-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

/* Hero Text - Preserving original styles */
.hero-text {
  text-align: left;
}

.service-hero .hero-text h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  background: linear-gradient(to right, var(--star-white), var(--electric-blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 2px;
}

.service-hero .hero-text p {
  font-size: 1.2rem;
  margin-bottom: 2.5rem;
  line-height: 1.6;
  color: var(--metallic);
}

/* Web Visualization - Preserving 3D effects */
.web-visualization {
  perspective: 1000px;
  transform-style: preserve-3d;
  animation: float 6s ease-in-out infinite;
}

.browser-window {
  background: rgba(10, 10, 22, 0.8);
  border-radius: 8px;
  border: 1px solid rgba(138, 43, 226, 0.3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  transform: rotateY(-15deg) rotateX(5deg);
  transition: transform 0.5s ease;
  overflow: hidden;
}

.browser-window:hover {
  transform: rotateY(-5deg) rotateX(2deg);
}

/* Browser Header with Dots - Preserving original styles */
.browser-header {
  padding: 0.8rem 1rem;
  background: rgba(5, 5, 16, 0.7);
  border-bottom: 1px solid rgba(138, 43, 226, 0.2);
  display: flex;
  align-items: center;
}

.browser-dots {
  display: flex;
  gap: 0.6rem;
}

.browser-dots span {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.browser-dots span:nth-child(1) {
  background: #ff5f56;
}

.browser-dots span:nth-child(2) {
  background: #ffbd2e;
}

.browser-dots span:nth-child(3) {
  background: #27c93f;
}

.browser-content {
  padding: 1.5rem;
}

/* Code Editor - Preserving original styles */
.code-editor {
  background: var(--space-black);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.editor-header {
  padding: 0.8rem 1rem;
  background: rgba(5, 5, 16, 0.8);
  border-bottom: 1px solid rgba(138, 43, 226, 0.2);
  display: flex;
  align-items: center;
}

.file-name {
  color: var(--metallic);
  font-size: 0.9rem;
  font-family: 'Courier New', monospace;
}

.editor-content {
  padding: 1.5rem;
}

.editor-content pre {
  margin: 0;
  overflow-x: auto;
}

.editor-content code {
  font-family: 'Courier New', monospace;
  color: var(--electric-blue);
  font-size: 0.95rem;
  line-height: 1.5;
  display: block;
}

/* Service Details - Keeping all 4 cards in one line on desktop */
.service-details {
  padding: 8rem 5%;
  background: rgba(5, 5, 16, 0.7);
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 5rem;
}

.section-header h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--star-white);
}

.section-header p {
  font-size: 1.1rem;
  color: var(--metallic);
  line-height: 1.6;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Feature Cards - Preserving 3D effects */
.feature-card {
  background: rgba(10, 10, 22, 0.7);
  border: 1px solid rgba(138, 43, 226, 0.2);
  border-radius: 8px;
  padding: 2.5rem;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(5px);
  transform-style: preserve-3d;
  perspective: 1000px;
  cursor: pointer;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(138, 43, 226, 0.1), rgba(0, 209, 255, 0.05));
  z-index: -1;
}

.feature-card:hover {
  transform: translateY(-10px) translateZ(20px);
  box-shadow: 0 20px 30px rgba(0, 209, 255, 0.3);
  border-color: var(--neon-purple);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--electric-blue);
}

.feature-card h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--star-white);
}

.feature-card p {
  color: var(--metallic);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-badges span {
  background: rgba(0, 209, 255, 0.1);
  color: var(--electric-blue);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid rgba(0, 209, 255, 0.3);
}

/* Tech Stack - Preserving original styles */
.tech-stack {
  padding: 8rem 5%;
  background: rgba(10, 10, 22, 0.5);
  position: relative;
}

.tech-tabs {
  max-width: 1200px;
  margin: 0 auto;
  background: rgba(10, 10, 22, 0.7);
  border: 1px solid rgba(138, 43, 226, 0.2);
  border-radius: 8px;
  overflow: hidden;
  backdrop-filter: blur(5px);
}

.tab-header {
  display: flex;
  border-bottom: 1px solid rgba(138, 43, 226, 0.2);
}

.tab-btn {
  flex: 1;
  padding: 1.2rem;
  background: transparent;
  border: none;
  color: var(--metallic);
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.tab-btn.active {
  color: var(--electric-blue);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--neon-purple), var(--electric-blue));
}

.tab-btn:hover:not(.active) {
  background: rgba(138, 43, 226, 0.1);
  color: var(--star-white);
}

.tab-content {
  padding: 2rem;
  display: none;
}

.tab-content.active {
  display: block;
}

.tech-items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

/* Tech Items - Preserving 3D effects */
.tech-item {
  background: rgba(10, 10, 22, 0.7);
  border: 1px solid rgba(138, 43, 226, 0.2);
  border-radius: 8px;
  padding: 2rem;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(5px);
  transform-style: preserve-3d;
  perspective: 1000px;
  cursor: pointer;
}

.tech-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(138, 43, 226, 0.1), rgba(0, 209, 255, 0.05));
  z-index: -1;
}

.tech-item:hover {
  transform: translateY(-10px) translateZ(20px);
  box-shadow: 0 20px 30px rgba(0, 209, 255, 0.3);
  border-color: var(--neon-purple);
}

.tech-logo {
  width: 60px;
  height: 60px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--electric-blue);
  background: rgba(0, 209, 255, 0.1);
  border-radius: 50%;
  border: 1px solid rgba(0, 209, 255, 0.3);
}

.tech-item h4 {
  font-family: 'Orbitron', sans-serif;
  color: var(--star-white);
  margin-bottom: 0.8rem;
  text-align: center;
}

.tech-item p {
  color: var(--metallic);
  font-size: 0.95rem;
  line-height: 1.6;
  text-align: center;
}

/* CTA Section - Preserving original styles */
.service-cta {
  padding: 6rem 5%;
  text-align: center;
  background: linear-gradient(135deg, rgba(138, 43, 226, 0.1), rgba(0, 209, 255, 0.05));
}

.service-cta h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--star-white);
}

.service-cta p {
  font-size: 1.1rem;
  color: var(--metallic);
  max-width: 700px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

/* Animation - Preserving original float effect */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* Navigation - Preserving original styles */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  transition: transform 0.3s ease-in-out;
  z-index: 1000;
}

nav.nav-hidden {
  transform: translateY(-100%);
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .tech-items {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .service-hero {
    padding: 6rem 5% 3rem;
    min-height: auto;
    height: auto;
  }
  
  .hero-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .hero-text {
    text-align: center;
    order: 2;
  }
  
  .hero-visual {
    order: 1;
    margin-bottom: 2rem;
    display: none; /* Hide the visual/code editor on mobile */
  }
  
  .service-hero .hero-text h1 {
    font-size: 2.2rem;
  }
  
  .service-hero .hero-text p {
    font-size: 1.1rem;
  }
  
  .web-visualization {
    display: none; /* Ensure code editor is hidden */
  }
  
  .browser-window {
    display: none; /* Ensure code editor is hidden */
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .tech-items {
    grid-template-columns: 1fr;
  }
  
  /* Disable 3D effects on mobile */
  .feature-card,
  .tech-item {
    transform: none !important;
    perspective: none !important;
  }
  
  .feature-card:hover,
  .tech-item:hover {
    transform: none !important;
    box-shadow: 0 5px 15px rgba(0, 209, 255, 0.2);
  }
}

/* iPhone notch adjustments */
@media only screen and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3),
       only screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2),
       only screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3),
       only screen and (device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3),
       only screen and (device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) {
  .service-hero {
    padding-top: calc(8rem + env(safe-area-inset-top));
  }
}

/* Disable 3D effects on touch devices */
@media (hover: none) {
  .web-visualization {
    perspective: none;
    transform-style: flat;
  }
  
  .browser-window {
    transform: none !important;
  }
  
  .browser-window:hover {
    transform: none !important;
  }
  
  .feature-card,
  .tech-item {
    transform: none !important;
  }
  
  .feature-card:hover,
  .tech-item:hover {
    transform: none !important;
  }
}

/* Safari-specific performance optimizations */
@supports (-webkit-touch-callout: none) {
  .service-hero {
    -webkit-overflow-scrolling: touch;
  }
  
  /* Force hardware acceleration */
  .hero-content {
    -webkit-transform: translateZ(0);
  }
  
  /* Fix for font rendering */
  body {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
}