/* Mobile Fixes - Comprehensive responsive improvements */

/* Base mobile styles for all devices under 768px */
@media (max-width: 768px) {
  /* Global spacing and typography */
  body {
    font-size: 16px;
    line-height: 1.6;
  }
  
  section {
    padding: 60px 20px !important;
  }
  
  /* Navigation fixes */
  .nav-menu {
    padding: 15px 20px;
  }
  
  .nav-container {
    padding: 0;
  }
  
  .nav-logo {
    font-size: 1.5rem;
  }
  
  .nav-links {
    top: 60px !important;
    padding: 30px 20px !important;
    gap: 20px !important;
  }
  
  .nav-link {
    font-size: 1.1rem !important;
    padding: 12px 0 !important;
    width: 100%;
    text-align: left;
  }
  
  /* Hero section mobile */
  .hero {
    min-height: 100vh;
    padding: 100px 20px 60px !important;
  }
  
  .hero-content {
    padding: 0 !important;
  }
  
  .hero-title {
    font-size: clamp(2rem, 10vw, 3rem) !important;
    line-height: 1.2 !important;
    margin-bottom: 20px !important;
  }
  
  .hero-subtitle {
    font-size: 1rem !important;
    margin-bottom: 15px !important;
  }
  
  .typewriter {
    font-size: 1rem !important;
  }
  
  .hero-description {
    font-size: 1rem !important;
    line-height: 1.6 !important;
    margin-bottom: 30px !important;
    padding: 0 10px;
  }
  
  /* Hero CTA buttons */
  .hero-cta {
    display: flex;
    flex-direction: column !important;
    gap: 15px !important;
    width: 100%;
    padding: 0 10px;
  }
  
  .btn-primary, .btn-secondary {
    width: 100% !important;
    padding: 16px 30px !important;
    font-size: 1rem !important;
    justify-content: center;
  }
  
  /* Work section mobile */
  .work-container {
    padding: 0 !important;
  }
  
  .work-item {
    grid-template-columns: 1fr !important;
    gap: 30px !important;
    margin-bottom: 60px !important;
    padding: 0 !important;
  }
  
  .work-media {
    height: 250px !important;
    width: 100% !important;
  }
  
  .work-content {
    padding: 0 !important;
    text-align: left !important;
  }
  
  .work-title {
    font-size: 1.5rem !important;
    margin-bottom: 10px !important;
  }
  
  .work-role {
    font-size: 0.9rem !important;
    margin-bottom: 15px !important;
  }
  
  .work-description {
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    margin-bottom: 20px !important;
  }
  
  .work-tags {
    flex-wrap: wrap;
    gap: 8px !important;
    margin-bottom: 25px !important;
  }
  
  .tag {
    font-size: 0.75rem !important;
    padding: 6px 12px !important;
  }
  
  /* Enhanced portfolio button mobile */
  .work-link.enhanced-button {
    width: 100% !important;
    padding: 16px 30px !important;
    font-size: 1rem !important;
    justify-content: center !important;
    margin-top: 20px !important;
  }
  
  .work-link.enhanced-button .button-text {
    font-size: 1rem !important;
  }
  
  /* About section mobile */
  .about-container {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
    padding: 0 !important;
  }
  
  .about-content h2 {
    font-size: 2rem !important;
    margin-bottom: 20px !important;
  }
  
  .about-text {
    font-size: 1rem !important;
    line-height: 1.7 !important;
    margin-bottom: 30px !important;
  }
  
  .about-stats {
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
    margin-bottom: 30px !important;
  }
  
  .stat-item {
    padding: 20px 15px !important;
  }
  
  .stat-number {
    font-size: 1.8rem !important;
  }
  
  .stat-label {
    font-size: 0.85rem !important;
  }
  
  /* Skills section mobile */
  .skills-container {
    padding: 0 !important;
  }
  
  .skill-category {
    margin-bottom: 30px !important;
  }
  
  .skill-category h4 {
    font-size: 1.1rem !important;
    margin-bottom: 15px !important;
  }
  
  .skill-items {
    gap: 10px !important;
  }
  
  .skill-item {
    font-size: 0.85rem !important;
    padding: 8px 14px !important;
  }
  
  /* Contact section mobile */
  .contact-container {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
    padding: 0 !important;
  }
  
  .contact-info h2 {
    font-size: 2rem !important;
    margin-bottom: 20px !important;
  }
  
  .contact-text {
    font-size: 1rem !important;
    margin-bottom: 30px !important;
  }
  
  .contact-form {
    padding: 30px 20px !important;
  }
  
  .form-group input,
  .form-group textarea {
    font-size: 16px !important; /* Prevents zoom on iOS */
    padding: 14px 16px !important;
  }
  
  .btn-submit {
    width: 100% !important;
    padding: 16px !important;
    font-size: 1rem !important;
  }
  
  /* Portfolio page mobile */
  .portfolio-hero {
    padding: 100px 20px 60px !important;
  }
  
  .hero-title {
    font-size: clamp(2rem, 10vw, 3rem) !important;
  }
  
  .stats-container {
    grid-template-columns: 1fr 1fr !important;
    gap: 30px !important;
    margin-top: 40px !important;
  }
  
  .stat-number {
    font-size: 2rem !important;
  }
  
  .filter-buttons {
    display: flex;
    overflow-x: auto;
    gap: 10px !important;
    padding: 0 20px 10px !important;
    -webkit-overflow-scrolling: touch;
  }
  
  .filter-btn {
    white-space: nowrap;
    padding: 10px 20px !important;
    font-size: 0.9rem !important;
    flex-shrink: 0;
  }
  
  .portfolio-grid {
    grid-template-columns: 1fr !important;
    gap: 25px !important;
    padding: 0 20px 60px !important;
  }
  
  .client-card {
    margin: 0 !important;
  }
  
  .client-logo {
    height: 180px !important;
    padding: 20px !important;
  }
  
  .client-info {
    padding: 25px 20px !important;
  }
  
  .client-name {
    font-size: 1.5rem !important;
  }
  
  .client-description {
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
  }
  
  /* Project grid mobile */
  .projects-grid {
    margin-top: 40px !important;
  }
  
  .project-cards {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  
  .project-card {
    padding: 25px 20px !important;
  }
  
  /* Footer mobile */
  footer {
    padding: 40px 20px !important;
  }
  
  .footer-content {
    flex-direction: column !important;
    gap: 30px !important;
    text-align: center !important;
  }
  
  .social-links {
    justify-content: center !important;
  }
}

/* Extra small devices (phones under 480px) */
@media (max-width: 480px) {
  /* Even smaller text adjustments */
  .hero-title {
    font-size: 2rem !important;
  }
  
  .hero-subtitle {
    font-size: 0.9rem !important;
  }
  
  .section-title {
    font-size: 1.8rem !important;
  }
  
  .work-title {
    font-size: 1.3rem !important;
  }
  
  /* Single column stats on very small screens */
  .about-stats {
    grid-template-columns: 1fr !important;
  }
  
  .stats-container {
    grid-template-columns: 1fr !important;
  }
  
  /* Smaller padding on very small screens */
  section {
    padding: 50px 15px !important;
  }
  
  .hero {
    padding: 80px 15px 50px !important;
  }
}

/* Landscape mobile fixes */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: 80px 20px 40px !important;
  }
  
  .hero-cta {
    flex-direction: row !important;
    flex-wrap: wrap;
  }
  
  .btn-primary, .btn-secondary {
    width: auto !important;
    flex: 1;
    min-width: 150px;
  }
}

/* Fix for iOS Safari */
@supports (-webkit-touch-callout: none) {
  .nav-links {
    -webkit-transform: translateX(100%);
  }
  
  .nav-links.active {
    -webkit-transform: translateX(0);
  }
}

/* Ensure text is readable on all mobile devices */
@media (max-width: 768px) {
  p, li, span, div {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  /* Prevent horizontal scroll */
  * {
    max-width: 100vw !important;
  }
  
  .hero-visual,
  .work-media video,
  .parallax-text {
    display: none !important;
  }
}

/* Button hover states disabled on mobile */
@media (hover: none) and (pointer: coarse) {
  .btn-primary:hover,
  .btn-secondary:hover,
  .work-link.enhanced-button:hover {
    transform: none !important;
  }
}