/* ===== Responsive Design ===== */

/* Large Desktop (1440px and up) */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .section-header h2 {
        font-size: 3rem;
    }
}

/* Desktop (1024px - 1439px) */
@media (max-width: 1439px) {
    .container {
        max-width: 1200px;
    }
}

/* Mobile and Tablet (1023px and below) */
@media (max-width: 1023px) {
    .container {
        padding: 0 20px;
        max-width: 100%;
    }
    
    /* Fix page alignment */
    body {
        overflow-x: hidden;
    }
    
    /* Ensure proper mobile layout */
    * {
        box-sizing: border-box;
    }
    
    /* Fix logo and navbar container */
    .logo-image {
        height: 40px !important;
        width: auto;
    }
    
    .nav-logo {
        flex-shrink: 0;
    }
    
    /* Navigation link styles for mobile */
    .nav-menu .nav-link,
    .nav-menu .nav-item .nav-link {
        padding: 1.25rem 0 !important;
        width: 100% !important;
        border-bottom: 1px solid #e2e8f0 !important;
        font-size: 1.2rem !important;
        display: block !important;
        color: #2d3748 !important;
        text-decoration: none !important;
        font-weight: 500 !important;
        transition: all 0.3s ease !important;
        line-height: 1.5 !important;
    }
    
    .nav-menu .nav-link:hover,
    .nav-menu .nav-item .nav-link:hover,
    .nav-menu .nav-link.active,
    .nav-menu .nav-item .nav-link.active {
        color: #FF6B00 !important;
        padding-left: 0.75rem !important;
        background: rgba(255, 107, 0, 0.05) !important;
    }
    
    .nav-menu .nav-item {
        width: 100% !important;
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Add close button style in menu */
    .nav-menu::before {
        content: "×" !important;
        position: absolute !important;
        top: 20px !important;
        right: 20px !important;
        font-size: 2rem !important;
        color: #666 !important;
        cursor: pointer !important;
        z-index: 10000 !important;
    }
    
    .nav-menu .nav-dropdown {
        width: 100%;
    }
    
    .nav-menu .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: var(--light-gray);
        box-shadow: none;
        margin-left: 1rem;
        border-radius: 0;
    }
    
    .nav-toggle,
    .hamburger {
        display: flex !important;
        z-index: 1001;
        flex-direction: column;
        cursor: pointer;
        width: 30px;
        height: 30px;
        justify-content: center;
        align-items: center;
        position: relative;
        order: 3;
    }
    
    .nav-toggle .bar,
    .hamburger .bar {
        width: 25px;
        height: 3px;
        background: var(--dark-text);
        margin: 3px 0;
        transition: var(--transition-fast);
        border-radius: 2px;
    }
    
    /* Critical mobile navbar fixes */
    .nav-container {
        padding: 1rem 15px;
        width: 100%;
        box-sizing: border-box;
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
    }
    
    .nav-logo {
        order: 1;
        flex-shrink: 0;
    }
    
    .nav-menu {
        position: fixed !important;
        top: 0 !important;
        right: -100% !important;
        width: 300px !important;
        height: 100vh !important;
        max-height: 100vh !important;
        min-height: 100vh !important;
        background: #ffffff !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: flex-start !important;
        padding: 80px 2rem 2rem !important;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3) !important;
        transition: right 0.3s ease !important;
        z-index: 99999 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        order: 2;
        display: flex !important;
        margin: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        left: auto !important;
        bottom: 0 !important;
        transform: none !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .nav-menu.active {
        right: 0 !important;
    }
    
    .nav-toggle.active .bar:nth-child(2),
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active .bar:nth-child(1),
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    
    .nav-toggle.active .bar:nth-child(3),
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
    
    /* Hero Section */
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 250px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Page Headers */
    .page-header-content h1 {
        font-size: 2.5rem;
    }
    
    .page-header-content p {
        font-size: 1.125rem;
    }
    
    /* Two Column Layouts */
    .innovation-content,
    .story-content,
    .tech-content,
    .nav-content,
    .cloud-content,
    .docking-content,
    .industry-content,
    .contact-form-content,
    .featured-content,
    .rd-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .industry-content.reverse {
        grid-template-columns: 1fr;
    }
    
    /* Mission & Vision */
    .mission-vision-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Products Grid */
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    /* Newsletter Form */
    .newsletter-form {
        flex-direction: column;
        align-items: center;
    }
    
    .newsletter-form input {
        margin-bottom: 1rem;
    }
    
    /* Timeline */
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        flex-direction: row !important;
        margin-left: 40px;
    }
    
    .timeline-year {
        position: absolute;
        left: -60px;
        width: 60px;
        height: 60px;
        font-size: 0.9rem;
    }
    
    .timeline-content {
        margin: 0;
        max-width: none;
    }
    
    /* Research & Development Stats */
    .rd-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .rd-number {
        font-size: 2rem;
    }
    
    /* Mobile Timeline - Complete Override for Clean Layout */
    .company-timeline {
        padding: 60px 0 !important;
        background: #f8f9fa !important;
    }
    
    .timeline {
        padding: 0 !important;
        max-width: none !important;
    }
    
    .timeline-item {
        display: block !important;
        background: white !important;
        margin: 0 1rem 1.5rem 1rem !important;
        padding: 0 !important;
        border-radius: 12px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
        overflow: hidden !important;
    }
    
    .timeline-item:nth-child(even) {
        display: block !important;
        flex-direction: initial !important;
    }
    
    .timeline-year {
        display: block !important;
        background: linear-gradient(135deg, #1a365d, #004AAD) !important;
        color: white !important;
        padding: 1rem 1.5rem !important;
        margin: 0 !important;
        font-size: 1.1rem !important;
        font-weight: 700 !important;
        border-radius: 0 !important;
        text-align: center !important;
        min-width: auto !important;
        align-self: initial !important;
        box-shadow: 0 2px 4px rgba(26, 54, 93, 0.3) !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .timeline-content {
        padding: 1.5rem !important;
        margin: 0 !important;
        background: white !important;
    }
    
    .timeline-content h3 {
        font-size: 1.2rem !important;
        margin-bottom: 0.75rem !important;
        color: #1a365d !important;
        font-weight: 600 !important;
    }
    
    .timeline-content p {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
        color: #4a5568 !important;
        margin: 0 !important;
    }

    /* Additional Mobile Fixes */
    .page-header {
        padding: 80px 0 40px;
    }
    
    .page-header-content h1 {
        font-size: 1.5rem;
    }
    
    /* Product Filters Mobile */
    .product-filters {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .filter-btn {
        min-width: 100px;
        padding: 0.5rem 1rem;
    }
    
    /* Mobile Image Fixes */
    .product-drone-img,
    .blog-image img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }
}

/* Tablet Portrait (481px - 767px) */
@media (max-width: 767px) {
    /* Typography */
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 250px;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .page-header-content h1 {
        font-size: 2rem;
    }
    
    /* Container */
    .container {
        padding: 0 20px;
    }
    
    /* Sections */
    section {
        padding: 60px 0;
    }
    
    .page-header {
        padding: 100px 0 60px;
    }
    
    /* Navigation */
    .nav-menu {
        width: 100%;
        right: -100%;
    }
    
    .nav-container {
        padding: 0.75rem 0;
    }
    
    /* Hero */
    .hero {
        height: 80vh;
        min-height: 600px;
    }
    
    .hero-content {
        padding: 1rem 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        padding: 1.5rem 0;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    /* Grids */
    .products-grid,
    .industries-grid,
    .services-grid,
    .blog-grid,
    .team-grid,
    .values-grid,
    .certifications-grid,
    .sensors-grid,
    .contact-info-grid,
    .dealers-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    /* Buttons */
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-buttons .btn {
        width: 100%;
        max-width: 280px;
    }
    
    /* Forms */
    .search-form {
        flex-direction: column;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .product-actions .btn {
        width: 100%;
    }
    
    /* Comparison Table */
    .comparison-table {
        font-size: 0.9rem;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 0.75rem 0.5rem;
    }
    
    /* Process Timeline */
    .process-timeline {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Support Tiers */
    .tier-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .tier-card.featured {
        transform: none;
    }
    
    /* Additional Services */
    .additional-services-grid {
        grid-template-columns: 1fr;
    }
    
    /* Innovation Timeline */
    .timeline-year {
        width: 50px;
        height: 50px;
        left: -45px;
        font-size: 0.8rem;
    }
    
    /* Research Stats */
    .rd-stats {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    /* Modal */
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header,
    .modal-body {
        padding: 1.5rem;
    }
    
    /* Blog Featured */
    .featured-content {
        grid-template-columns: 1fr;
    }
    
    .featured-text {
        padding: 2rem;
    }
    
    .featured-image {
        min-height: 250px;
    }
    
    /* Category Filters */
    .category-tabs,
    .filter-tabs,
    .category-filters {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .tab-btn,
    .filter-btn,
    .category-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* Force mobile navigation visibility */
@media (max-width: 768px) {
    .nav-toggle,
    .hamburger {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Ensure navbar doesn't overflow */
    .navbar {
        width: 100vw;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .nav-container {
        width: 100%;
        max-width: 100%;
        padding: 1rem 15px;
        margin: 0;
    }
    
    /* Ensure logo doesn't take too much space */
    .logo-image {
        height: 40px !important;
        max-height: 40px !important;
    }
    
    /* Add overlay when menu is open */
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .mobile-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

/* Mobile Large (376px - 480px) */
@media (max-width: 480px) {
    /* Typography */
    .hero-title {
        font-size: 1.75rem;
    }
    
    .section-header h2 {
        font-size: 1.75rem;
    }
    
    .page-header-content h1 {
        font-size: 1.75rem;
    }
    
    /* Container */
    .container {
        padding: 0 15px;
        max-width: 100%;
    }
    
    /* Navigation Mobile Fix */
    .nav-menu {
        width: 280px;
        padding: 80px 1.5rem 2rem;
    }
    
    .nav-toggle,
    .hamburger {
        display: flex !important;
    }
    
    /* Fix horizontal scroll issue */
    .nav-container {
        padding: 1rem 10px;
    }
    
    .logo-image {
        height: 35px !important;
    }
    
    /* Sections */
    section {
        padding: 40px 0;
    }
    
    /* Hero */
    .hero {
        height: 70vh;
        min-height: 500px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    /* Cards */
    .product-card,
    .service-card,
    .industry-card,
    .blog-card,
    .project-card,
    .team-member,
    .contact-card,
    .dealer-card {
        margin-bottom: 1rem;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* Navigation */
    .nav-container {
        padding: 0.5rem 0;
    }
    
    .nav-logo img {
        height: 35px;
    }
    
    /* Scroll to Top */
    .scroll-to-top {
        width: 45px;
        height: 45px;
        bottom: 1rem;
        right: 1rem;
    }
    
    /* Specifications */
    .product-specs {
        grid-template-columns: 1fr;
    }
    
    /* Benefits */
    .benefits-grid {
        grid-template-columns: 1fr;
    }
    
    /* Project Stats */
    .project-stats {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    /* Article Meta */
    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Article Tags */
    .article-tags,
    .project-tech {
        justify-content: center;
    }
}

/* Mobile Small (320px - 375px) */
@media (max-width: 375px) {
    /* Typography */
    .hero-title {
        font-size: 1.5rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .page-header-content h1 {
        font-size: 1.5rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }
    
    /* Container */
    .container {
        padding: 0 10px;
    }
    
    /* Sections */
    section {
        padding: 30px 0;
    }
    
    .page-header {
        padding: 90px 0 50px;
    }
    
    /* Hero */
    .hero-subtitle {
        font-size: 1rem;
    }
    
    /* Cards Padding */
    .product-info,
    .service-card,
    .industry-card,
    .blog-content,
    .project-content,
    .member-info,
    .contact-card,
    .dealer-card {
        padding: 1.5rem;
    }
    
    /* Modal */
    .modal-header,
    .modal-body {
        padding: 1rem;
    }
    
    /* Form */
    .form {
        padding: 1.5rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    /* Newsletter */
    .newsletter-content {
        padding: 0 1rem;
    }
    
    /* Blog Preview Mobile */
    .preview-articles {
        grid-template-columns: 1fr;
    }
    
    .preview-article {
        padding: 1rem;
    }
    
    /* Map Overlay Mobile */
    .map-overlay {
        position: static;
        margin-top: 1rem;
        background: var(--clean-white);
        backdrop-filter: none;
    }
    
    /* Stats Numbers */
    .stat-number {
        font-size: 1.75rem;
    }
    
    .rd-number {
        font-size: 1.75rem;
    }
    
    /* Icon Sizes */
    .industry-icon,
    .service-icon,
    .value-icon,
    .cert-icon,
    .sensor-icon,
    .contact-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    /* Tech Showcase */
    .tech-circle {
        width: 150px;
        height: 150px;
        font-size: 3rem;
    }
    
    /* Visual Placeholders */
    .visual-placeholder,
    .ai-visualization {
        height: 250px;
    }
    
    .drone-placeholder,
    .blog-placeholder,
    .project-placeholder {
        font-size: 2.5rem;
    }
    
    /* Timeline */
    .timeline-year {
        width: 40px;
        height: 40px;
        left: -35px;
        font-size: 0.7rem;
    }
    
    .timeline-content {
        padding: 1.5rem;
    }
    
    /* Featured Article */
    .featured-text {
        padding: 1.5rem;
    }
    
    .article-author {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    /* Success Message */
    .success-content {
        padding: 2rem;
        margin: 1rem;
    }
    
    .success-content i {
        font-size: 3rem;
    }
    
    /* Contact Hours */
    .contact-hours {
        font-size: 0.9rem;
    }
    
    /* Dealer Services */
    .dealer-services {
        justify-content: center;
    }
    
    /* CTA Content */
    .cta-content h2 {
        font-size: 1.5rem;
    }
    
    .cta-content p {
        font-size: 1rem;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    /* Ensure crisp rendering on high DPI displays */
    .nav-logo img,
    .footer-logo img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Landscape Orientation on Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        height: 100vh;
    }
    
    .hero-content {
        padding: 1rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-buttons {
        flex-direction: row;
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        padding: 1rem 0;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .scroll-to-top,
    .hero-buttons,
    .cta-buttons,
    .btn,
    .newsletter,
    .modal,
    .preloader {
        display: none !important;
    }
    
    .hero {
        height: auto;
        padding: 2rem 0;
    }
    
    .page-header {
        padding: 2rem 0;
    }
    
    section {
        padding: 2rem 0;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    * {
        color: #000 !important;
        background: #fff !important;
    }
    
    a {
        text-decoration: underline;
    }
    
    .card,
    .product-card,
    .service-card {
        border: 1px solid #000;
        box-shadow: none;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .scroll-to-top,
    .btn,
    .nav-link {
        transition: none !important;
    }
    
    .hero,
    .tech-circle,
    .ai-core {
        animation: none !important;
    }
}

/* Dark Mode Support (if user prefers) */
@media (prefers-color-scheme: dark) {
    /* This would be implemented if dark mode is required */
    /* Currently maintaining light theme as per requirements */
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.3);
        --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.4);
        --shadow-heavy: 0 8px 30px rgba(0, 0, 0, 0.5);
    }
    
    .btn-outline {
        border-width: 3px;
    }
    
    .nav-link::after {
        height: 3px;
    }
    
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        border-width: 3px;
    }
}

/* Focus Styles for Accessibility */
@media (prefers-reduced-motion: no-preference) {
    .btn:focus,
    .nav-link:focus,
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        outline: 3px solid var(--accent-orange);
        outline-offset: 2px;
    }
}
