/* iBornToCode Custom Styles */

/* Global mobile viewport fixes */
* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  width: 100%;
}

body {
  overflow-x: hidden;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Content Container Styles */
.content-container {
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.dark .content-container {
  background: linear-gradient(135deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.1) 100%);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Slide Animation Styles */
.slide {
  transition: all 1000ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-indicator {
  cursor: pointer;
  transition: all 300ms ease;
}

.slide-indicator:hover {
  transform: scale(1.2);
}

/* Navigation Hover Effects */
.nav-link {
  position: relative;
  overflow: hidden;
}

.nav-link:hover {
  transform: translateY(-1px);
}

/* Mobile Menu Animations */
#mobileMenu {
  transition: all 300ms ease-in-out;
  transform-origin: top;
}

#mobileMenu.hidden {
  transform: scaleY(0);
  opacity: 0;
}

#mobileMenu:not(.hidden) {
  transform: scaleY(1);
  opacity: 1;
}

/* Enhanced Backdrop Blur for Header */
header {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Cookie Consent Banner Styles */
#cookieConsent {
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#cookieConsent.show {
  transform: translateY(0);
}

@media (max-width: 768px) {
  #cookieConsent {
    padding: 1rem;
  }
}

/* Fade In Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

/* Additional Utility Classes */
.animate-pulse-slow {
  animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.dark ::-webkit-scrollbar-track {
  background: #374151;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
  background: #6b7280;
}

::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Loading Animation */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-spin-slow {
  animation: spin 3s linear infinite;
}

/* Smooth Focus Styles */
button:focus,
input:focus,
textarea:focus {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/* Selection Colors */
::selection {
  background-color: #6366f1;
  color: white;
}

.dark ::selection {
  background-color: #818cf8;
  color: #111827;
}

/* Print Styles */
@media print {
  header,
  footer,
  #cookieConsent {
    display: none !important;
  }
  
  body {
    color: black !important;
    background: white !important;
  }
}

/* MOBILE SPECIFIC FIXES FOR HERO CAROUSEL
========================================= */
@media (max-width: 480px) {
  /* Ultra mobile specific hero fixes */
  #home .slide-container {
    height: 550px !important;
    overflow: hidden !important;
    position: relative !important;
    margin-bottom: 4rem !important;
  }
  
  .slide {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    padding: 1rem !important;
    overflow-y: auto !important;
  }
  
  /* Ultra mobile dark mode text visibility */
  .dark p,
  .dark span {
    color: white !important;
  }
  
  /* Exception for navigation and buttons (keep original colors) */
  .dark .nav-link,
  .dark button span,
  .dark .bg-indigo-600,
  .dark .bg-green-100 {
    color: inherit !important;
  }
  
  /* Ensure carousel navigation doesn't get cut */
  .slide-indicators-container {
    position: relative !important;
    margin-top: 2rem !important;
    margin-bottom: 3rem !important;
    padding-bottom: 2rem !important;
  }
  
  /* Footer ultra-mobile fixes */
  footer {
    overflow-x: hidden !important;
    padding: 2rem 1rem !important;
  }
  
  footer .grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
  
  footer .max-w-7xl {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

/* SSL TRUST LOGO STYLES
====================== */
.ssl-trust-container {
  display: inline-block;
  vertical-align: middle;
}

/* Mobile SSL logo adjustments */
@media (max-width: 640px) {
  .ssl-trust-container img {
    max-width: 120px !important;
    height: auto !important;
  }
}

/* DESKTOP LAYOUT RESTORATION 
============================ */
@media (min-width: 769px) {
  /* Ensure proper desktop footer layout */
  footer .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 2rem !important;
  }
  
  footer .col-span-2 {
    grid-column: span 2 !important;
  }
}

/* ENHANCED RESPONSIVE DESIGN FOR MOBILE
=========================================== */

/* Mobile-First Viewport Improvements */
@media (max-width: 480px) {
  /* Ultra-small mobile devices */
  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Header adjustments */
  header .max-w-7xl {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Logo sizing for small screens */
  #themeLogo {
    height: 3rem !important;
    width: auto;
  }
  
  /* Navigation improvements */
  .nav-link {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
  
  /* Hero section mobile optimization */
  .hero-section {
    padding-bottom: 4rem !important;
  }
  
  .hero-section h1 {
    font-size: 2rem !important;
    line-height: 2.25rem !important;
    margin-bottom: 1rem;
  }
  
  .hero-section p {
    font-size: 1rem !important;
    line-height: 1.5rem !important;
  }
  
  /* Fix carousel container height and spacing */
  .slide {
    height: auto !important;
    min-height: 500px;
    padding-bottom: 2rem;
  }
  
  /* Slide indicators positioning */
  .slide-indicator {
    margin-bottom: 2rem !important;
  }
  
  /* Button adjustments */
  .btn-mobile {
    width: 100% !important;
    margin-bottom: 0.75rem;
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }
  
  /* Card spacing */
  .card-container {
    margin-bottom: 1.5rem;
    padding: 1rem;
  }
}

@media (max-width: 640px) {
  /* Small mobile devices (sm breakpoint) */
  
  /* Global mobile container fixes */
  body, html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }
  
  /* Container spacing */
  .px-4 {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }
  
  /* Mobile toggle button - icon only */
  #toggleDark {
    padding: 0.75rem !important;
    min-width: auto !important;
  }
  
  #toggleDark span {
    display: none !important;
  }
  
  #toggleDark svg {
    margin: 0 !important;
  }
  
  /* Mobile dark mode text visibility fix - Comprehensive */
  .dark .text-gray-600.dark\:text-gray-300,
  .dark .text-gray-600.dark\:text-gray-400,
  .dark .text-gray-700.dark\:text-gray-300,
  .dark .text-gray-500.dark\:text-gray-400 {
    color: white !important;
  }
  
  /* Specific mobile dark mode fixes for hero section */
  .dark p[class*="text-gray-"][class*="dark:text-gray-"],
  .dark span[class*="text-gray-"][class*="dark:text-gray-"] {
    color: white !important;
  }
  
  /* Ensure readability for small text in mobile dark mode */
  .dark .text-xs[class*="dark:text-gray-"],
  .dark .text-sm[class*="dark:text-gray-"] {
    color: white !important;
  }
  
  /* Hero section mobile specific fixes */
  #home {
    padding-bottom: 2rem !important;
  }
  
  .slide-container {
    height: auto !important;
    min-height: 450px !important;
    margin-bottom: 3rem !important;
  }
  
  /* Slide indicators container */
  .slide-indicators-container {
    margin-top: 2rem !important;
    margin-bottom: 2rem !important;
  }
  
  /* Footer mobile specific fixes */
  footer {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  footer .grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  
  footer .col-span-2 {
    grid-column: span 1 !important;
  }
  
  /* Input groups in footer */
  footer .flex {
    flex-wrap: wrap !important;
  }
  
  footer input[type="email"] {
    width: 100% !important;
    margin-bottom: 0.5rem !important;
    border-radius: 0.5rem !important;
  }
  
  footer button {
    width: 100% !important;
    border-radius: 0.5rem !important;
  }
  
  /* Typography scaling */
  h1 {
    font-size: 2.5rem !important;
    line-height: 2.75rem !important;
  }
  
  h2 {
    font-size: 2rem !important;
    line-height: 2.25rem !important;
  }
  
  h3 {
    font-size: 1.5rem !important;
    line-height: 1.75rem !important;
  }
  
  /* Enhanced touch targets */
  button, .btn, a[role="button"] {
    min-height: 44px; /* Apple's recommended touch target */
    min-width: 44px;
  }
  
  /* Improved form elements */
  input[type="email"], 
  input[type="text"], 
  textarea {
    padding: 1rem;
    font-size: 1rem;
    border-radius: 0.5rem;
  }
  
  /* Better spacing for content sections */
  .section-padding {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  
  /* Carousel improvements */
  .carousel-slide {
    min-height: auto;
    padding: 1.5rem 1rem;
  }
  
  /* Footer adjustments */
  footer {
    text-align: center;
    overflow-x: hidden !important;
    width: 100vw;
    max-width: 100%;
  }
  
  footer .grid {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }
  
  footer .flex {
    flex-direction: column !important;
    gap: 1rem;
  }
  
  /* Prevent horizontal overflow */
  footer * {
    max-width: 100%;
    word-wrap: break-word;
  }
}

@media (max-width: 768px) {
  /* Medium mobile devices (md breakpoint) */
  
  /* Navigation enhancements */
  #mobileMenu {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 1rem;
    margin: 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  }
  
  .dark #mobileMenu {
    background: rgba(31, 41, 55, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  /* Hero section improvements */
  .hero-content {
    text-align: center;
    padding: 2rem 1rem;
  }
  
  /* Fix hero section carousel height and spacing */
  #home {
    padding-bottom: 6rem !important;
  }
  
  .slide-container {
    height: 500px !important;
    overflow: hidden !important;
    position: relative !important;
  }
  
  .slide {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    padding-bottom: 1rem !important;
  }
  
  .slide-indicators-container {
    margin-top: 3rem !important;
    padding-bottom: 2rem !important;
  }
  
  /* Feature cards stack properly */
  .feature-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }
  
  /* Statistics section */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem;
  }
  
  /* Technology stack */
  .tech-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem;
  }
  
  /* Contact form improvements */
  .contact-form {
    padding: 1.5rem;
  }
  
  /* Modal improvements */
  .modal-content {
    margin: 1rem;
    max-height: 90vh;
    overflow-y: auto;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  /* Tablet devices */
  
  /* Adjust grid layouts for tablets */
  .feature-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .stats-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
  
  /* Hero section for tablets */
  .hero-content {
    padding: 3rem 2rem;
  }
  
  /* Navigation spacing */
  .nav-link {
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
  }
}

/* Modern Mobile Features */

/* Safe area support for devices with notches */
@supports (padding: max(0px)) {
  header {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-top: max(0px, env(safe-area-inset-top));
  }
  
  footer {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
  
  .mobile-safe-area {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}

/* Touch-friendly improvements */
.touch-target {
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Improved focus states for mobile accessibility */
button:focus,
a:focus,
input:focus,
textarea:focus {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/* Better hover states for touch devices */
@media (hover: hover) {
  .hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  }
}

/* Smooth scrolling improvements */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* PWA-specific mobile styles */
.pwa-mode {
  /* Remove any browser-specific margins when in PWA */
  margin: 0;
  padding: 0;
}

.pwa-mode header {
  /* Account for no browser chrome in PWA mode */
  padding-top: max(1rem, env(safe-area-inset-top));
}

/* Loading states for better mobile experience */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

.dark .loading-skeleton {
  background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
  background-size: 200% 100%;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Improved text readability on mobile */
@media (max-width: 768px) {
  body {
    font-size: 1rem;
    line-height: 1.6;
  }
  
  .text-sm {
    font-size: 0.9rem !important;
  }
  
  .text-xs {
    font-size: 0.8rem !important;
  }
  
  /* Better contrast for mobile screens */
  .text-gray-600 {
    color: #4b5563 !important;
  }
  
  .dark .text-gray-400 {
    color: #9ca3af !important;
  }
}

/* Enhanced mobile navigation */
.mobile-nav-item {
  padding: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: background-color 0.2s ease;
}

.mobile-nav-item:hover {
  background-color: rgba(99, 102, 241, 0.05);
}

.mobile-nav-item:last-child {
  border-bottom: none;
}

/* Mobile-optimized animations */
@media (max-width: 768px) {
  .animate-fade-in {
    animation-duration: 0.3s;
  }
  
  .transition-all {
    transition-duration: 0.2s;
  }
  
  /* Reduce complex animations on mobile for performance */
  .complex-animation {
    animation: none;
  }
}

/* Improved mobile forms */
.mobile-form-container {
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.dark .mobile-form-container {
  background: rgba(31, 41, 55, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Mobile-specific utility classes */
.mobile-center {
  text-align: center;
}

.mobile-full-width {
  width: 100% !important;
}

.mobile-hidden {
  display: none !important;
}

@media (min-width: 769px) {
  .mobile-hidden {
    display: block !important;
  }
}

.desktop-hidden {
  display: block !important;
}

@media (min-width: 769px) {
  .desktop-hidden {
    display: none !important;
  }
}

/* ========================================
   END MOBILE RESPONSIVE ENHANCEMENTS
   ======================================== */
