/* ===== HOSTINGER COMPATIBLE RESPONSIVE DESIGN ===== */

/* ===== RESPONSIVE VARIABLES ===== */
:root {
  /* Breakpoints */
  --breakpoint-xl: 1200px;
  --breakpoint-lg: 992px;
  --breakpoint-md: 768px;
  --breakpoint-sm: 576px;
  --breakpoint-xs: 480px;
  
  /* Fluid typography */
  --fluid-text-6xl: clamp(2.5rem, 5vw, 3.75rem);
  --fluid-text-5xl: clamp(2rem, 4vw, 3rem);
  --fluid-text-4xl: clamp(1.75rem, 3.5vw, 2.25rem);
  --fluid-text-3xl: clamp(1.5rem, 3vw, 1.875rem);
  --fluid-text-2xl: clamp(1.25rem, 2.5vw, 1.5rem);
  --fluid-text-xl: clamp(1.125rem, 2vw, 1.25rem);
  
  /* Fluid spacing */
  --fluid-space-3xl: clamp(3rem, 6vw, 6rem);
  --fluid-space-2xl: clamp(2rem, 4vw, 4rem);
  --fluid-space-xl: clamp(1.5rem, 3vw, 3rem);
  --fluid-space-lg: clamp(1rem, 2vw, 2rem);
}

/* ===== FLUID TYPOGRAPHY OVERRIDES ===== */
.hero-title {
  font-size: var(--fluid-text-6xl);
}

.hero-subtitle {
  font-size: var(--fluid-text-2xl);
}

.section-title {
  font-size: var(--fluid-text-4xl);
}

.about-intro {
  font-size: var(--fluid-text-xl);
}

/* ===== LARGE TABLET (1024px and below) ===== */
@media (max-width: 1024px) {
  .container {
    padding: 0 var(--fluid-space-lg);
  }

  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--fluid-space-2xl);
  }

  .hero-image {
    order: -1;
  }

  .hero-avatar {
    width: clamp(250px, 35vw, 300px);
    height: clamp(250px, 35vw, 300px);
    font-size: clamp(50px, 8vw, 70px);
  }

  .about-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--fluid-space-2xl);
  }

  .about-image {
    order: -1;
  }

  .about-avatar {
    width: clamp(220px, 30vw, 280px);
    height: clamp(280px, 40vw, 350px);
    font-size: clamp(45px, 6vw, 60px);
  }

  .timeline::before {
    left: 160px;
  }

  .timeline-item {
    grid-template-columns: 140px 40px 1fr;
  }

  .timeline-item::before {
    left: 149px;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }

  .contact-content {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .contact-info {
    order: -1;
  }
}

/* ===== TABLET/MOBILE TRANSITION (992px and below) ===== */
@media (max-width: 992px) {
  .navbar {
    top: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
  }
  
  .nav-menu {
    gap: var(--space-md);
  }
  
  .nav-link {
    font-size: var(--text-sm);
    padding: var(--space-xs) var(--space-sm);
  }
}

/* ===== MOBILE NAVIGATION (768px and below) ===== */
@media (max-width: 768px) {
  .navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    transform: none;
    border-radius: 0;
    padding: var(--space-sm) var(--fluid-space-lg);
    background: rgba(10, 10, 15, 0.95);
    z-index: 1000;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background: rgba(10, 10, 15, 0.98);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-xl);
    transition: left var(--duration-slow) var(--ease-out);
    z-index: 1001;
  }

  @supports (backdrop-filter: blur(20px)) {
    .nav-menu {
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
    }
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-link {
    font-size: var(--text-xl);
    padding: var(--space-md);
  }

  .nav-toggle {
    display: flex;
    z-index: 1002;
  }

  .nav-toggle.active .bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .nav-toggle.active .bar:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active .bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .hero {
    padding-top: 80px;
    padding-bottom: var(--fluid-space-xl);
    min-height: calc(100vh - 80px);
  }

  .hero-avatar {
    width: clamp(200px, 30vw, 250px);
    height: clamp(200px, 30vw, 250px);
    font-size: clamp(40px, 6vw, 55px);
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
  }

  .btn {
    width: 100%;
    max-width: clamp(200px, 70vw, 280px);
    justify-content: center;
    font-size: var(--text-base);
  }

  .section-title {
    margin-bottom: var(--fluid-space-xl);
  }

  .about-stats {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    max-width: 400px;
    margin: 0 auto;
  }

  /* Mobile Timeline */
  .timeline {
    padding-left: 0;
    max-width: 100%;
  }

  .timeline::before {
    left: var(--space-lg);
    width: 2px;
  }

  .timeline-item {
    display: block;
    margin-bottom: var(--space-xl);
    padding-left: calc(var(--space-lg) + var(--space-xl));
    position: relative;
  }

  .timeline-item::before {
    left: calc(var(--space-lg) - 9px);
    top: var(--space-lg);
    width: 18px;
    height: 18px;
  }

  .timeline-date {
    justify-content: flex-start;
    padding: 0 0 var(--space-md) 0;
  }

  .timeline-content {
    margin: 0;
    padding: var(--space-lg);
  }

  .timeline-content:hover {
    transform: translateY(-4px);
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    max-width: 600px;
    margin: 0 auto;
  }

  .skill-items {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    max-width: 500px;
    margin: 0 auto;
  }

  .project-image {
    height: 180px;
    font-size: 40px;
  }

  .contact-content {
    gap: var(--fluid-space-xl);
    max-width: 600px;
    margin: 0 auto;
  }

  .contact-info,
  .contact-form {
    padding: var(--fluid-space-xl);
  }

  .social-links {
    gap: var(--space-sm);
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: var(--space-md);
  }
}

/* ===== SMALL MOBILE (480px and below) ===== */
@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-sm);
  }

  .navbar {
    padding: var(--space-xs) var(--space-sm);
  }

  .hero-avatar {
    width: clamp(160px, 40vw, 200px);
    height: clamp(160px, 40vw, 200px);
    font-size: clamp(35px, 8vw, 45px);
  }

  .about-avatar {
    width: clamp(180px, 35vw, 220px);
    height: clamp(240px, 45vw, 280px);
    font-size: clamp(35px, 7vw, 45px);
  }

  .about-stats {
    max-width: 300px;
  }

  .timeline-item {
    padding-left: calc(var(--space-sm) + var(--space-lg));
  }

  .timeline::before {
    left: var(--space-sm);
  }

  .timeline-item::before {
    left: calc(var(--space-sm) - 8px);
    width: 16px;
    height: 16px;
  }

  .timeline-content {
    padding: var(--space-md);
  }

  .skill-items {
    grid-template-columns: 1fr;
  }

  .project-image {
    height: 150px;
    font-size: 30px;
  }

  .tech-tag {
    font-size: 10px;
    padding: 4px 8px;
  }

  .projects-grid {
    max-width: 350px;
  }

  .contact-content {
    max-width: 350px;
  }

  .contact-info,
  .contact-form {
    padding: var(--space-md);
  }

  .contact-item {
    flex-direction: column;
    text-align: center;
    gap: var(--space-xs);
  }
}

/* ===== ULTRA SMALL MOBILE (320px and below) ===== */
@media (max-width: 320px) {
  .hero-avatar {
    width: 140px;
    height: 140px;
    font-size: 28px;
  }

  .about-avatar {
    width: 160px;
    height: 210px;
    font-size: 30px;
  }

  .about-stats,
  .projects-grid,
  .contact-content {
    max-width: 280px;
  }

  .btn {
    font-size: var(--text-sm);
    padding: var(--space-sm) var(--space-md);
  }
}

/* Landscape Orientation */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: 100px 0 var(--space-xl);
  }

  .hero-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    align-items: center;
  }

  .hero-image {
    order: 0;
  }

  .hero-avatar {
    width: 180px;
    height: 180px;
  }

  .hero-buttons {
    flex-direction: row;
    gap: var(--space-md);
  }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
  .hero-avatar,
  .about-avatar {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

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

  .hero-avatar,
  .timeline-item::before,
  body::before,
  body::after {
    animation: none !important;
  }
}

/* Print Styles */
@media print {
  * {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  .navbar,
  .nav-toggle,
  .hero-buttons,
  .contact-form,
  .social-links {
    display: none !important;
  }

  .hero,
  .about,
  .experience,
  .skills,
  .projects,
  .contact {
    padding: 1rem 0 !important;
    break-inside: avoid;
  }

  .glass-card,
  .timeline-content,
  .project-card {
    border: 1px solid #ccc !important;
    background: white !important;
  }

  .text-gradient {
    color: black !important;
    -webkit-text-fill-color: black !important;
  }
}

/* Focus Styles for Accessibility */
*:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

button:focus-visible,
.btn:focus-visible,
.nav-link:focus-visible {
  outline-offset: 4px;
}

/* Loading Animation (Hostinger Safe) */
@keyframes loadingShimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.loading {
  background: linear-gradient(90deg, transparent 25%, rgba(255, 255, 255, 0.1) 50%, transparent 75%);
  background-size: 200px 100%;
  animation: loadingShimmer 1.5s infinite;
}