/* ============================================
   HCJK Collection - Responsive Styles
   Mobile-First Responsive Design
   ============================================ */

/* ==================== BACK TO TOP BUTTON ==================== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--color-secondary);
  color: var(--color-white);
  border: none;
  border-radius: var(--border-radius-full);
  font-size: 24px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: var(--transition-all);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-index-fixed);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: var(--color-accent);
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

/* ==================== NOTIFICATION STYLES ==================== */
.notification {
  position: fixed;
  top: 100px;
  right: 20px;
  padding: var(--spacing-md) var(--spacing-lg);
  background-color: var(--color-white);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-index-tooltip);
  opacity: 0;
  transform: translateX(400px);
  transition: var(--transition-all);
  max-width: 350px;
}

.notification.show {
  opacity: 1;
  transform: translateX(0);
}

.notification-success {
  border-left: 4px solid var(--color-success);
}

.notification-error {
  border-left: 4px solid var(--color-error);
}

.notification-warning {
  border-left: 4px solid var(--color-warning);
}

.notification-info {
  border-left: 4px solid var(--color-info);
}

/* ==================== EXTRA SMALL DEVICES (Phones, less than 640px) ==================== */
@media (max-width: 639px) {
  /* Typography */
  body {
    font-size: 15px;
  }
  
  h1 {
    font-size: clamp(2rem, 8vw, 3rem);
  }
  
  h2 {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }
  
  /* Container */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Sections */
  .section {
    padding: var(--spacing-2xl) 0;
  }
  
  /* Hero */
  .hero-content {
    padding: var(--spacing-md);
  }
  
  .hero-title {
    font-size: clamp(2.5rem, 10vw, 4rem);
    margin-bottom: var(--spacing-md);
  }
  
  .hero-subtitle {
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-lg);
  }
  
  .hero-description {
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-xl);
  }
  
  .hero-cta {
    flex-direction: column;
    width: 100%;
  }
  
  .hero-cta .btn {
    width: 100%;
  }
  
  /* Navigation */
  .navbar {
    height: 60px;
  }
  
  .navbar-brand img {
    height: 30px;
  }
  
  .navbar-menu {
    top: 60px;
  }
  
  /* Grid */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
  
  /* Gallery */
  .gallery {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
  
  .gallery-masonry {
    column-count: 1;
  }
  
  /* Cards */
  .card {
    margin-bottom: var(--spacing-lg);
  }
  
  .card-body {
    padding: var(--spacing-lg);
  }
  
  /* Buttons */
  .btn {
    padding: 0.625rem 1.5rem;
    font-size: var(--font-size-sm);
  }
  
  .btn-lg {
    padding: 0.875rem 2rem;
    font-size: var(--font-size-base);
  }
  
  /* Forms */
  .form-control {
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  /* Testimonials */
  .testimonial {
    padding: var(--spacing-lg);
  }
  
  .testimonial-text {
    font-size: var(--font-size-base);
  }
  
  .testimonial-author {
    flex-direction: column;
    text-align: center;
  }
  
  .testimonial-info {
    text-align: center;
  }
  
  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }
  
  .footer-social {
    justify-content: center;
  }
  
  /* Modal */
  .modal-content {
    max-width: 95%;
  }
  
  .modal-nav {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  
  .modal-prev {
    left: 10px;
  }
  
  .modal-next {
    right: 10px;
  }
  
  /* Back to top */
  .back-to-top {
    width: 45px;
    height: 45px;
    bottom: 20px;
    right: 20px;
    font-size: 20px;
  }
  
  /* Notification */
  .notification {
    right: 10px;
    left: 10px;
    max-width: none;
  }
  
  /* Filter buttons */
  .filter-buttons {
    gap: var(--spacing-xs);
  }
  
  .filter-btn {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.75rem;
  }
}

/* ==================== SMALL DEVICES (Tablets, 640px and up) ==================== */
@media (min-width: 640px) and (max-width: 767px) {
  /* Grid */
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Gallery */
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .gallery-masonry {
    column-count: 2;
  }
  
  /* Footer */
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==================== MEDIUM DEVICES (Tablets, 768px and up) ==================== */
@media (min-width: 768px) and (max-width: 1023px) {
  /* Container */
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  
  /* Grid */
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Gallery */
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .gallery-masonry {
    column-count: 2;
  }
  
  /* Hero */
  .hero-title {
    font-size: clamp(3.5rem, 8vw, 5rem);
  }
  
  /* Cards */
  .card-horizontal {
    flex-direction: row;
  }
  
  .card-horizontal .card-img {
    width: 40%;
  }
  
  .card-horizontal .card-body {
    width: 60%;
  }
  
  /* Footer */
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==================== LARGE DEVICES (Desktops, 1024px and up) ==================== */
@media (min-width: 1024px) {
  /* Gallery */
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .gallery-masonry {
    column-count: 3;
  }
  
  /* Hover effects (only on devices that support hover) */
  @media (hover: hover) {
    .card:hover {
      transform: translateY(-8px);
    }
    
    .gallery-item:hover img {
      transform: scale(1.08);
    }
    
    .btn:hover {
      transform: translateY(-2px);
    }
  }
}

/* ==================== EXTRA LARGE DEVICES (Large desktops, 1280px and up) ==================== */
@media (min-width: 1280px) {
  /* Container */
  .container {
    max-width: 1400px;
  }
  
  /* Gallery */
  .gallery {
    grid-template-columns: repeat(4, 1fr);
  }
  
  /* Hero */
  .hero-title {
    font-size: clamp(4rem, 6vw, 6rem);
  }
}

/* ==================== 2XL DEVICES (Larger desktops, 1536px and up) ==================== */
@media (min-width: 1536px) {
  /* Container */
  .container {
    max-width: 1600px;
  }
  
  /* Typography */
  body {
    font-size: 18px;
  }
}

/* ==================== LANDSCAPE ORIENTATION ==================== */
@media (max-height: 500px) and (orientation: landscape) {
  /* Hero adjustments for landscape */
  .hero {
    min-height: auto;
    padding: var(--spacing-3xl) 0;
  }
  
  .hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: var(--spacing-sm);
  }
  
  .hero-subtitle {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-md);
  }
  
  .hero-description {
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-lg);
  }
  
  /* Navigation */
  .navbar-menu {
    max-height: 70vh;
    overflow-y: auto;
  }
}

/* ==================== TOUCH DEVICES ==================== */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .card:hover {
    transform: none;
  }
  
  .gallery-item:hover img {
    transform: none;
  }
  
  /* Increase touch target sizes */
  .btn {
    min-height: 44px;
  }
  
  .navbar-link {
    padding: var(--spacing-md) 0;
  }
  
  .filter-btn {
    min-height: 44px;
  }
}

/* ==================== HIGH RESOLUTION DISPLAYS ==================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Optimize images for retina displays */
  /* This is handled in HTML with srcset attribute */
}

/* ==================== DARK MODE SUPPORT (Optional) ==================== */
@media (prefers-color-scheme: dark) {
  /* Uncomment to enable dark mode */
  /*
  :root {
    --color-primary: #F5F5F5;
    --color-background: #1A1A1A;
    --color-white: #2C2C2C;
    --color-light-gray: #3A3A3A;
    --color-medium-gray: #4A4A4A;
    --color-dark-gray: #E0E0E0;
  }
  
  .navbar {
    background-color: #2C2C2C;
  }
  
  .card {
    background-color: #2C2C2C;
  }
  
  .footer {
    background-color: #1A1A1A;
  }
  */
}

/* ==================== REDUCED MOTION ==================== */
@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;
  }
  
  .scroll-reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ==================== PRINT STYLES ==================== */
@media print {
  /* Hide non-essential elements */
  .navbar,
  .back-to-top,
  .notification,
  .hero-cta,
  .footer-social,
  .no-print {
    display: none !important;
  }
  
  /* Optimize for printing */
  body {
    background: white;
    color: black;
    font-size: 12pt;
  }
  
  .container {
    max-width: 100%;
    padding: 0;
  }
  
  .section {
    padding: 1cm 0;
  }
  
  /* Ensure images fit on page */
  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }
  
  /* Page breaks */
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    page-break-inside: avoid;
  }
  
  .card,
  .testimonial {
    page-break-inside: avoid;
  }
  
  /* Show URLs for links */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
  
  /* Remove shadows and transitions */
  * {
    box-shadow: none !important;
    text-shadow: none !important;
    transition: none !important;
  }
}

/* ==================== ACCESSIBILITY - HIGH CONTRAST MODE ==================== */
@media (prefers-contrast: high) {
  :root {
    --color-primary: #000000;
    --color-secondary: #000000;
    --color-accent: #000000;
    --color-background: #FFFFFF;
  }
  
  .btn {
    border: 2px solid currentColor;
  }
  
  a {
    text-decoration: underline;
  }
}

/* ==================== CUSTOM BREAKPOINT UTILITIES ==================== */

/* Hide on mobile */
@media (max-width: 767px) {
  .hide-mobile {
    display: none !important;
  }
}

/* Hide on tablet */
@media (min-width: 768px) and (max-width: 1023px) {
  .hide-tablet {
    display: none !important;
  }
}

/* Hide on desktop */
@media (min-width: 1024px) {
  .hide-desktop {
    display: none !important;
  }
}

/* Show only on mobile */
.show-mobile {
  display: none !important;
}

@media (max-width: 767px) {
  .show-mobile {
    display: block !important;
  }
}

/* Show only on tablet */
.show-tablet {
  display: none !important;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .show-tablet {
    display: block !important;
  }
}

/* Show only on desktop */
.show-desktop {
  display: none !important;
}

@media (min-width: 1024px) {
  .show-desktop {
    display: block !important;
  }
}