/* DesafioPro Hotsite - Responsive Styles */

/* Mobile First Approach - Base styles are for mobile */

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
  .container {
    padding: 0 var(--space-lg);
  }
  
  .hero-title {
    font-size: var(--font-size-5xl);
  }
  
  .hero-actions {
    justify-content: flex-start;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  
  .footer-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-xl);
  }
  
  /* Navigation */
  .nav-toggle {
    display: none;
  }
  
  .nav-menu {
    display: flex;
  }
  
  /* Hero Section */
  .hero-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
  }
  
  .hero-title {
    font-size: var(--font-size-6xl);
  }
  
  .hero-subtitle {
    font-size: var(--font-size-xl);
  }
  
  .phone-mockup {
    width: 280px;
    height: 560px;
  }
  
  /* Features */
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2xl);
  }
  
  /* Gallery */
  .carousel-slide {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
  }
  
  .screenshot-image {
    max-width: 280px;
  }
  
  /* CTA */
  .cta-actions {
    flex-direction: row;
  }
  
  /* Footer */
  .footer-content {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
  .container {
    padding: 0 var(--space-2xl);
  }
  
  /* Hero Section */
  .hero {
    min-height: 100vh;
  }
  
  .hero-content {
    gap: var(--space-4xl);
  }
  
  .phone-mockup {
    width: 320px;
    height: 640px;
  }
  
  /* Features */
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* Gallery */
  .screenshot-image {
    max-width: 320px;
  }
  
  /* Footer */
  .footer-content {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  .container {
    max-width: 1200px;
  }
  
  .phone-mockup {
    width: 350px;
    height: 700px;
  }
  
  .screenshot-image {
    max-width: 350px;
  }
}

/* Mobile-specific styles (up to 767px) */
@media (max-width: 767px) {
  /* Navigation */
  .navbar .container {
    padding: var(--space-sm) var(--space-md);
  }
  
  .nav-menu {
    position: fixed;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface-primary);
    flex-direction: column;
    padding: var(--space-xl);
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
  }
  
  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .nav-toggle {
    display: flex;
  }
  
  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  
  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }
  
  /* Hero Section */
  .hero {
    padding-top: 100px;
    min-height: auto;
    padding-bottom: var(--space-4xl);
  }
  
  .hero-content {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
    text-align: center;
  }
  
  .hero-title {
    font-size: var(--font-size-4xl);
  }
  
  .hero-subtitle {
    font-size: var(--font-size-lg);
  }
  
  .hero-actions {
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
  }
  
  .phone-mockup {
    width: 250px;
    height: 500px;
    transform: rotate(0deg);
  }
  
  .phone-mockup:hover {
    transform: scale(1.02);
  }
  
  /* Sections */
  .features,
  .gallery,
  .cta {
    padding: var(--space-3xl) 0;
  }
  
  .section-title {
    font-size: var(--font-size-3xl);
  }
  
  .section-subtitle {
    font-size: var(--font-size-lg);
  }
  
  /* Features */
  .features-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  
  .feature-card {
    padding: var(--space-xl);
  }
  
  .feature-icon {
    width: 60px;
    height: 60px;
  }
  
  .feature-icon img {
    width: 30px;
    height: 30px;
  }
  
  .feature-title {
    font-size: var(--font-size-xl);
  }
  
  /* Gallery */
  .carousel-slide {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    text-align: center;
    padding: var(--space-lg);
  }
  
  .screenshot-container {
    order: -1;
  }
  
  .screenshot-image {
    max-width: 250px;
  }
  
  .screenshot-title {
    font-size: var(--font-size-2xl);
  }
  
  .screenshot-description {
    font-size: var(--font-size-base);
  }
  
  .carousel-controls {
    padding: 0 var(--space-md);
  }
  
  .carousel-btn {
    width: 40px;
    height: 40px;
  }
  
  .carousel-btn svg {
    width: 20px;
    height: 20px;
  }
  
  /* CTA */
  .cta-title {
    font-size: var(--font-size-3xl);
  }
  
  .cta-subtitle {
    font-size: var(--font-size-lg);
  }
  
  .cta-actions {
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
  }
  
  .download-btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
  
  /* Footer */
  .footer {
    padding: var(--space-3xl) 0 var(--space-xl);
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    text-align: center;
  }
  
  .footer-brand {
    justify-content: center;
  }
  
  .social-links {
    justify-content: center;
  }
  
  .footer-section-title {
    font-size: var(--font-size-lg);
  }
  
  .footer-bottom {
    text-align: center;
  }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575px) {
  .container {
    padding: 0 var(--space-sm);
  }
  
  /* Hero */
  .hero-title {
    font-size: var(--font-size-3xl);
  }
  
  .hero-subtitle {
    font-size: var(--font-size-base);
  }
  
  .phone-mockup {
    width: 200px;
    height: 400px;
  }
  
  /* Buttons */
  .btn-large {
    padding: var(--space-md) var(--space-lg);
    font-size: var(--font-size-base);
  }
  
  /* Features */
  .feature-card {
    padding: var(--space-lg);
  }
  
  /* Gallery */
  .screenshot-image {
    max-width: 200px;
  }
  
  .carousel-slide {
    padding: var(--space-md);
  }
  
  /* Download buttons */
  .download-btn {
    padding: var(--space-sm) var(--space-md);
  }
  
  .download-icon {
    width: 24px;
    height: 24px;
  }
  
  .download-label {
    font-size: var(--font-size-xs);
  }
  
  .download-store {
    font-size: var(--font-size-base);
  }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 600px) {
  .hero {
    min-height: auto;
    padding: var(--space-2xl) 0;
  }
  
  .hero-content {
    gap: var(--space-xl);
  }
  
  .phone-mockup {
    width: 200px;
    height: 400px;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .phone-mockup {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
  
  .screenshot-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Reduced motion preferences */
@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;
  }
  
  .phone-mockup {
    transform: none !important;
  }
  
  .phone-mockup:hover {
    transform: none !important;
  }
  
  .feature-card:hover {
    transform: none !important;
  }
  
  .carousel-track {
    transition: none !important;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --surface-primary: #0F172A;
    --surface-secondary: #1E293B;
    --surface-tertiary: #334155;
    --surface-card: #1E293B;
    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-tertiary: #94A3B8;
    /* Page gradient adapted for dark mode */
    --page-gradient: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  }
  
  .navbar {
    background: rgba(15, 23, 42, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }
  
  .phone-mockup {
    background: linear-gradient(145deg, #1e293b, #334155);
  }
  
  .carousel-btn {
    background: rgba(30, 41, 59, 0.9);
  }
  
  .carousel-btn:hover {
    background: var(--surface-tertiary);
  }
}

/* Print styles */
@media print {
  .navbar,
  .carousel-controls,
  .carousel-indicators,
  .cta-actions {
    display: none !important;
  }
  
  .hero,
  .features,
  .gallery,
  .cta,
  .footer {
    page-break-inside: avoid;
    padding: var(--space-lg) 0 !important;
  }
  
  .hero-content,
  .carousel-slide {
    grid-template-columns: 1fr !important;
    gap: var(--space-lg) !important;
  }
  
  .phone-mockup {
    transform: none !important;
    width: 200px !important;
    height: 400px !important;
  }
  
  .screenshot-image {
    max-width: 200px !important;
  }
  
  * {
    color: #000 !important;
    background: #fff !important;
  }
  
  .gradient-text {
    -webkit-text-fill-color: #000 !important;
  }
}

/* Accessibility improvements */
@media (prefers-contrast: high) {
  :root {
    --primary-color: #4338CA;
    --secondary-color: #047857;
    --accent-color: #D97706;
  }
  
  .btn-outline {
    border-width: 3px;
  }
  
  .card {
    border-width: 2px;
    border-color: var(--text-tertiary);
  }
}

/* Focus improvements for keyboard navigation */
@media (prefers-reduced-motion: no-preference) {
  *:focus {
    transition: outline-offset 0.2s ease;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .btn,
  .carousel-btn,
  .indicator,
  .nav-link,
  .footer-link,
  .social-link {
    min-height: 44px;
    min-width: 44px;
  }
  
  .feature-card:hover,
  .phone-mockup:hover,
  .card:hover {
    transform: none;
  }
  
  .carousel-btn {
    width: 56px;
    height: 56px;
  }
  
  .indicator {
    width: 16px;
    height: 16px;
  }
}