/* Enhanced Mobile Responsiveness */

/* Mobile-first approach adjustments */
:root {
  --header-height: 70px;
  --section-padding-mobile: 60px 0;
}

/* Improved mobile header */
@media (max-width: 768px) {
  header {
    height: var(--header-height);
  }
  
  .header-container {
    padding: 0;
  }
  
  .logo {
    font-size: 1.4rem;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Hamburger menu animation */
  .mobile-menu-btn {
    display: block;
    width: 30px;
    height: 25px;
    position: relative;
    cursor: pointer;
    z-index: 1002;
  }
  
  .mobile-menu-btn span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
  }
  
  .mobile-menu-btn span:nth-child(1) {
    top: 0px;
  }
  
  .mobile-menu-btn span:nth-child(2),
  .mobile-menu-btn span:nth-child(3) {
    top: 10px;
  }
  
  .mobile-menu-btn span:nth-child(4) {
    top: 20px;
  }
  
  .mobile-menu-btn.open span:nth-child(1) {
    top: 10px;
    width: 0%;
    left: 50%;
  }
  
  .mobile-menu-btn.open span:nth-child(2) {
    transform: rotate(45deg);
  }
  
  .mobile-menu-btn.open span:nth-child(3) {
    transform: rotate(-45deg);
  }
  
  .mobile-menu-btn.open span:nth-child(4) {
    top: 10px;
    width: 0%;
    left: 50%;
  }
  
  /* Improved mobile navigation */
  nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background-color: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  nav.active {
    right: 0;
  }
  
  nav ul {
    flex-direction: column;
    padding: 0 30px;
    height: auto;
  }
  
  nav ul li {
    margin: 15px 0;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.4s ease;
    transition-delay: 0.1s;
  }
  
  nav.active ul li {
    opacity: 1;
    transform: translateX(0);
  }
  
  nav.active ul li:nth-child(1) { transition-delay: 0.1s; }
  nav.active ul li:nth-child(2) { transition-delay: 0.2s; }
  nav.active ul li:nth-child(3) { transition-delay: 0.3s; }
  nav.active ul li:nth-child(4) { transition-delay: 0.4s; }
  nav.active ul li:nth-child(5) { transition-delay: 0.5s; }
  nav.active ul li:nth-child(6) { transition-delay: 0.6s; }
  
  nav ul li a {
    display: block;
    font-size: 1.2rem;
    padding: 10px 0;
  }
  
  /* Mobile overlay */
  .mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
  }
  
  .mobile-overlay.active {
    opacity: 1;
    visibility: visible;
  }
}

/* Improved responsive sections */
@media (max-width: 768px) {
  section {
    padding: var(--section-padding-mobile);
  }
  
  .section-header {
    margin-bottom: 40px;
  }
  
  .section-header h2 {
    font-size: 2.2rem;
  }
  
  .section-header p {
    font-size: 1rem;
    padding: 0 15px;
  }
  
  /* Hero section mobile adjustments */
  .hero {
    height: 100vh;
    min-height: 600px;
    padding: 120px 0 60px;
  }
  
  .hero h1 {
    font-size: 2.5rem;
    line-height: 1.2;
  }
  
  .hero p {
    font-size: 1.1rem;
  }
  
  .hero-btns {
    flex-direction: column;
    gap: 15px;
    align-items: center;
  }
  
  .hero-btns .btn {
    width: 100%;
    max-width: 250px;
    text-align: center;
  }
  
  /* Improved grid layouts for mobile */
  .features-grid,
  .investment-structure,
  .financial-charts-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .diff-container,
  .contact-container,
  .footer-container {
    flex-direction: column;
    gap: 30px;
  }
  
  .diff-item,
  .contact-info,
  .contact-form,
  .footer-col {
    flex: 1 1 100%;
  }
  
  /* Improved card layouts for mobile */
  .feature-card,
  .diff-item,
  .investment-card,
  .chart-container {
    padding: 20px;
    margin-bottom: 20px;
  }
  
  /* Improved financial section for mobile */
  .financial-highlights-enhanced {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  
  .highlight-item-enhanced {
    padding: 15px;
    min-height: 120px;
  }
  
  .highlight-item-enhanced h4 {
    font-size: 2rem;
  }
  
  .highlight-item-enhanced p {
    font-size: 0.9rem;
  }
  
  .financial-table-enhanced th,
  .financial-table-enhanced td {
    padding: 10px;
    font-size: 0.9rem;
  }
  
  /* Improved form elements for touch */
  .form-group {
    margin-bottom: 15px;
  }
  
  .form-control {
    padding: 15px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .btn {
    padding: 15px 25px;
    min-height: 50px; /* Better touch target */
  }
  
  /* Improved tab navigation for mobile */
  .nav-tabs-enhanced {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 0 10px;
  }
  
  .nav-tabs-enhanced .nav-item {
    margin: 5px;
    flex: 1 1 calc(50% - 10px);
  }
  
  .nav-tabs-enhanced .nav-link {
    padding: 12px 15px;
    font-size: 0.9rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .section-header h2 {
    font-size: 1.8rem;
  }
  
  /* Adjust financial highlights for very small screens */
  .financial-highlights-enhanced {
    grid-template-columns: 1fr;
  }
  
  /* Adjust tab navigation for very small screens */
  .nav-tabs-enhanced .nav-item {
    flex: 1 1 100%;
  }
  
  /* Adjust footer for very small screens */
  .social-links {
    justify-content: center;
  }
  
  .copyright {
    font-size: 0.8rem;
  }
}

/* Tablet devices */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero h1 {
    font-size: 3rem;
  }
  
  .features-grid,
  .investment-structure {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .financial-charts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-container {
    gap: 30px;
  }
  
  .footer-col {
    flex: 1 1 calc(50% - 30px);
  }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    height: auto;
    min-height: 450px;
    padding: 100px 0;
  }
  
  .hero-content {
    max-width: 600px;
  }
  
  .hero h1 {
    font-size: 2.2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  nav {
    overflow-y: auto;
  }
}

/* Touch-specific optimizations */
@media (hover: none) {
  /* Disable hover effects that don't work well on touch devices */
  .feature-card:hover,
  .diff-item:hover,
  .investment-card:hover {
    transform: none;
  }
  
  /* Increase touch targets */
  nav ul li a,
  .btn,
  .form-control,
  .nav-tabs-enhanced .nav-link {
    padding: 12px 20px;
  }
  
  /* Add active state for touch feedback */
  .btn:active {
    transform: scale(0.98);
    background-color: var(--primary-color);
  }
}

/* High-resolution screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Optimize images for high-res displays */
  .hero,
  .cta {
    background-size: cover;
  }
}

/* Print styles */
@media print {
  header,
  footer,
  .hero-btns,
  .cta,
  .contact-form,
  .scroll-indicator {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }
  
  a {
    color: #000;
    text-decoration: underline;
  }
  
  .container {
    max-width: 100%;
    width: 100%;
  }
  
  section {
    padding: 20pt 0;
    page-break-inside: avoid;
  }
  
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    page-break-inside: avoid;
  }
  
  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }
  
  .financial-table-enhanced {
    border-collapse: collapse;
  }
  
  .financial-table-enhanced th,
  .financial-table-enhanced td {
    border: 1pt solid #ddd;
  }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
