/* ============================================= */
/* Responsive CSS - Portfolio Website            */
/* ============================================= */

/* Base Mobile-First Styles */
@media (max-width: 767px) {

  /* Global Reset */
  html {
    font-size: 14px;
  }

  body {
    line-height: 1.5;
    overflow-x: hidden;
  }

  /* Header & Navigation */
  .header {
    padding: 15px 0;
  }

  .logo a {
    font-size: 22px;
  }

  .main-nav {
    display: none;
  }

  .menu-toggle {
    display: flex;
    width: 48px;
    height: 48px;
    padding: 12px;
  }

  /* Hero Section */
  .hero {
    height: auto;
    padding: 100px 0 60px;
  }

  .hero .container {
    flex-direction: column;
  }

  .hero-content {
    padding-right: 0;
    text-align: center;
    margin-bottom: 40px;
  }

  .hero-title {
    font-size: 32px;
    word-break: break-word;
    hyphens: auto;
  }

  .hero-title .title-line {
    display: inline;
  }

  .hero-subtitle {
    font-size: 16px;
    margin: 0 auto 20px;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn-secondary {
    margin-left: 0;
    margin-top: 15px;
  }

  /* About Section */
  .about-content {
    flex-direction: column;
  }

  .about-image {
    margin-bottom: 30px;
  }

  /* Skills Section */
  .skills {
    overflow-x: hidden;
  }

  .skill-item {
    min-width: 0;
  }

  .skill-chart {
    width: 100%;
    height: 200px;
  }

  /* Services */
  .services-grid {
    grid-template-columns: 1fr;
  }

  /* Portfolio */
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .portfolio-item {
    margin-bottom: 15px;
  }

  .portfolio-filter ul {
    flex-wrap: wrap;
    justify-content: center;
  }

  .portfolio-filter ul li {
    margin-bottom: 10px;
  }

  /* Contact */
  .contact-content {
    flex-direction: column;
  }

  .contact-info {
    margin-bottom: 30px;
  }

  .contact-form input,
  .contact-form textarea {
    width: 100%;
    box-sizing: border-box;
    font-size: 16px;
  }

  .form-submit {
    text-align: center;
  }

  /* Footer */
  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-social {
    justify-content: center;
    margin-top: 20px;
  }

  .footer-text p {
    font-size: 14px;
  }

  /* Modals */
  .modal-content {
    width: 95%;
    padding: 15px;
  }

  .modal-body {
    flex-direction: column;
  }

  .modal-image {
    margin-bottom: 20px;
  }

  /* Disable animations on mobile */
  [data-animation] {
    transition: none !important;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  /* Hide custom cursor on touch devices */
  @media (pointer: coarse) {

    .cursor,
    .cursor-follower {
      display: none !important;
    }
  }
}

/* Tablet Styles (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {

  /* Container */
  .container {
    padding: 0 30px;
  }

  /* Hero */

  .hero {
    height: 76vh;
  }

  .hero-title {
    font-size: 42px;
    text-align: left;
  }

  .hero-subtitle {
    text-align: left;
  }

  .hero .container {
    flex-direction: row;
  }

  /* About */
  .about-content {
    flex-direction: column;
  }

  .about-image {
    width: 50%;
    margin: 0 auto;
  }

  /* Services & Portfolio */
  .services-grid,
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Contact */
  .contact-content {
    flex-direction: column;
  }

  .contact-info {
    margin-bottom: 50px;
  }

  /* Modals */
  .modal-body {
    flex-direction: column;
  }
}

/* Small Desktop Styles (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {

  /* Container */
  .container {
    padding: 0 40px;
    width: 960px;
  }

  /* Hero */
  .hero-title {
    font-size: 54px;
  }

  /* Services */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Portfolio */
  .portfolio-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Large Desktop Styles (1200px and up) */
@media (min-width: 1200px) {
  /* Default styles handle this breakpoint */
}

/* Special Cases */
/* ============ */

/* Height adjustments for landscape mobile devices */
@media screen and (max-width: 767px) and (orientation: landscape) {
  .hero {
    height: auto;
    min-height: 100vh;
    padding: 80px 0;
  }

  .hero-title {
    font-size: 28px;
  }
}

/* Very small devices (phones under 360px) */
@media (max-width: 359px) {
  html {
    font-size: 13px;
  }

  .hero-title {
    font-size: 26px;
  }

  .btn {
    padding: 10px 15px;
    font-size: 14px;
  }

  .portfolio-filter ul li {
    padding: 5px 10px;
    font-size: 13px;
  }
}

/* High DPI (Retina) displays */
@media only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min-resolution: 192dpi) {
  /* You can add high-resolution image styles here */
}

/* Print styles */
@media print {
  body {
    background: white;
    color: black;
    font-size: 12pt;
  }

  .header,
  .footer,
  .mobile-menu,
  .menu-toggle,
  .scroll-progress,
  .cursor,
  .cursor-follower,
  .preloader {
    display: none !important;
  }

  a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    font-weight: normal;
  }

  .container {
    padding: 0 !important;
    max-width: 100% !important;
  }

  .section-padding {
    padding: 30px 0 !important;
  }

  .hero {
    padding: 30px 0 !important;
    height: auto !important;
  }

  .hero-image {
    display: none;
  }

  .hero-content {
    padding-right: 0 !important;
    text-align: left !important;
  }

  .hero-buttons {
    display: none;
  }

  [data-animation] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Reduced motion preference */
@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;
  }

  [data-animation] {
    transition: none !important;
    animation: none !important;
  }

  .preloader .loader-circle {
    animation: none !important;
  }
}

/* Dark mode preference (fallback) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg-color: #121212;
    --text-color: #f8f9fa;
    --card-bg: #1e1e1e;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --dark-color: #f8f9fa;
    --light-color: #1e1e1e;
    --gray-color: #b0b0b0;
  }
}

/* Touch device optimizations */
@media (pointer: coarse) {

  /* Increase tap targets */
  a,
  button,
  [role="button"],
  input,
  label,
  select,
  textarea {
    min-height: 48px;
    min-width: 48px;
  }

  /* Adjust hover states for touch */
  .service-item:hover,
  .portfolio-item:hover {
    transform: none !important;
  }
}

/* Very large screens (4K and above) */
@media (min-width: 2000px) {
  .container {
    max-width: 1600px;
  }

  .section-padding {
    padding: 150px 0;
  }

  .hero-title {
    font-size: 80px;
  }

  .section-title {
    font-size: 60px;
  }
}

/* Orientation-specific adjustments */
@media (orientation: portrait) and (max-width: 767px) {
  .hero {
    padding-top: 120px;
  }
}

@media (orientation: landscape) and (max-width: 991px) {
  .hero-content {
    padding-top: 40px;
  }
}

/* Pixel density and resolution adjustments */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (min-resolution: 144dpi) {
  /* High-resolution assets can be specified here */
}

/* Windows High Contrast Mode */
@media screen and (-ms-high-contrast: active) {
  * {
    background-color: windowText !important;
    color: window !important;
  }

  img {
    filter: contrast(100%) invert(100%) !important;
  }
}