/* Mobile and Tablet Optimization Styles */
:root {
    /* Maintain the same color scheme */
    --primary-color: #18223c;
    --secondary-color: #2a426e;
    --accent-color: #4b6fad;
    --accent-light: #6889c7;
    --text-light: #e6e6e6;
    --text-dark: #181818;
    --text-muted: #b3b3b3;
    --background-dark: #0f1524;
    --background-darker: #080d18;
    --card-background: rgba(26, 34, 56, 0.85);
    --transition: all 0.3s ease;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    --section-padding: 4rem 0; /* Reduced padding for mobile */
}

/* Base Styles for Mobile */
@media screen and (max-width: 992px) {
    .container {
        padding: 0 1.5rem;
    }
    
    /* Adjust section padding */
    .parallax-section {
        padding: var(--section-padding);
    }
    
    /* Reduce heading sizes */
    h1 {
        font-size: 2.2rem !important;
    }
    
    h2 {
        font-size: 1.8rem !important;
    }
    
    h3 {
        font-size: 1.4rem !important;
    }
    
    /* Adjust navigation */
    .nav-container {
        padding: 0.8rem 1.5rem;
    }
    
    .company-name {
        font-size: 1rem;
    }
    
    /* Adjust grid layouts */
    .two-column-grid,
    .feature-grid,
    .products-grid,
    .resources-grid,
    .case-studies-container,
    .threat-intel-grid,
    .deployment-tabs,
    .cloud-providers-layout {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
    
    /* Ensure cards are properly sized */
    .feature-card, 
    .product-card, 
    .resource-card, 
    .case-study, 
    .capability-card {
        height: 100%;
    }
    
    /* Adjust CTA buttons */
    .cta-buttons {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    /* Adjust header content */
    .header-content {
        padding: 4rem 0;
    }
}

/* Tablet Styles */
@media screen and (max-width: 768px) {
    /* Navigation menu for mobile/tablet */
    .menu-toggle {
        display: flex;
        z-index: 1001;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--background-dark);
        flex-direction: column;
        align-items: flex-start;
        padding: 5rem 2rem 2rem;
        transition: right 0.3s ease;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
        z-index: 1000;
        overflow-y: auto;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links a {
        display: block;
        padding: 1rem 0;
        width: 100%;
        border-bottom: 1px solid rgba(75, 111, 173, 0.1);
    }
    
    /* Hamburger menu styling */
    .menu-toggle {
        display: flex;
        cursor: pointer;
    }
    
    .menu-toggle span {
        background-color: var(--text-light);
        transition: var(--transition);
    }
    
    .menu-toggle.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
    
    /* Convert all multi-column layouts to single column */
    .two-column-grid,
    .feature-grid,
    .products-grid,
    .resources-grid,
    .case-studies-container,
    .cloud-providers-layout,
    .step-row,
    .tab-grid,
    .methodology-details,
    .deployment-tabs,
    .product-highlight .two-column-grid {
        grid-template-columns: 1fr;
    }
    
    /* Stack footer columns */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Adjust section headers */
    .section-header h2 {
        font-size: 1.6rem !important;
    }
    
    .section-description {
        font-size: 1rem;
        max-width: 100%;
    }
    
    /* Ensure product showcase is properly stacked */
    .product-showcase {
        flex-direction: column;
        gap: 2rem;
    }
    
    .product-image, .product-features {
        width: 100%;
    }
    
    /* Adjust tab system */
    .tabs-nav {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Improve card spacing */
    .feature-card, 
    .product-card, 
    .resource-card, 
    .case-study, 
    .capability-card {
        margin-bottom: 1.5rem;
    }
    
    /* Fix architecture diagrams */
    .architecture-section {
        padding: 3rem 0;
    }
    
    .architecture-section .two-column-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .architecture-intro {
        margin-bottom: 0.5rem;
    }
    
    .architecture-diagram {
        flex-direction: column;
        margin-top: 1rem;
    }
    
    .diagram-container {
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .layer-box {
        width: 100%;
        margin: 0 0 1.5rem 0;
        background-color: rgba(26, 34, 56, 0.95);
        border-radius: 10px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        padding: 1.5rem 1.25rem; /* Simplified padding */
        position: relative;
        border-left: 4px solid var(--accent-color);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        height: 170px; /* Fixed height instead of min-height */
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        overflow: hidden; /* Prevent content overflow */
    }
    
    .layer-box span {
        display: block;
        font-size: 1.2rem;
        font-weight: 600;
        color: var(--accent-light);
        margin-bottom: 0.75rem;
        font-family: 'Montserrat', sans-serif;
        padding-left: 0;
        line-height: 1.2;
    }
    
    .layer-description {
        font-size: 0.95rem;
        line-height: 1.5;
        color: var(--text-light);
        opacity: 0.9;
        padding-left: 0;
        flex-grow: 0; /* Don't stretch content */
        max-width: 100%;
        overflow: hidden; /* Hide overflow text */
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
    }
    
    /* Remove staggered positions and fix mobile view */
    .layer-1, .layer-2, .layer-3, .layer-4 {
        position: relative;
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        margin-bottom: 1.5rem;
        width: 100%;
        max-width: 100%;
    }
    
    /* Hide arrows on mobile */
    .arrows-container {
        display: none;
    }
    
    /* Add numbering for better hierarchy */
    .layer-4 span::before {
        content: "1. ";
        color: var(--accent-light);
        margin-right: 0.25rem;
    }
    
    .layer-3 span::before {
        content: "2. ";
        color: var(--accent-light);
        margin-right: 0.25rem;
    }
    
    .layer-2 span::before {
        content: "3. ";
        color: var(--accent-light);
        margin-right: 0.25rem;
    }
    
    .layer-1 span::before {
        content: "4. ";
        color: var(--accent-light);
        margin-right: 0.25rem;
    }
    
    /* Make tables responsive */
    .specs-table-container {
        overflow-x: auto;
    }
    
    /* Adjust forms for better mobile experience */
    .modal-content {
        width: 90%;
        max-width: 400px;
        padding: 1.5rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    /* Enhanced Product Lineup Mobile Layout */
    .product-grid-section {
        padding: 3rem 0;
    }
    
    .products-grid {
        display: block;
        margin: 0;
        padding: 0;
    }
    
    .product-card {
        margin-bottom: 1.5rem;
        height: auto;
        border-radius: 10px;
        overflow: hidden;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        border: 1px solid rgba(75, 111, 173, 0.2);
    }
    
    .product-card-inner {
        transform-style: flat;
        position: relative;
        transition: none;
        transform: none !important;
        height: auto;
    }
    
    .product-card-front, 
    .product-card-back {
        position: relative;
        transform: none !important;
        backface-visibility: visible;
        background: var(--card-background);
    }
    
    .product-card-front {
        padding: 1.5rem 1.25rem;
        display: flex;
        align-items: center;
        border-bottom: 1px solid rgba(75, 111, 173, 0.15);
        position: relative;
        min-height: 70px;
    }
    
    .product-card-back {
        padding: 1.25rem;
        display: block;
    }
    
    .product-card h3 {
        font-size: 1.3rem;
        margin: 0 0 0.25rem 0;
        flex: 1;
    }
    
    .product-tag {
        display: inline-block;
        font-size: 0.8rem;
        padding: 0.35rem 0.75rem;
        background: rgba(75, 111, 173, 0.2);
        border-radius: 20px;
        margin-bottom: 0;
        color: var(--accent-light);
    }
    
    .card-icon {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
        margin-right: 1rem;
    }
    
    .card-icon svg {
        width: 40px;
        height: 40px;
    }
    
    .product-card-front .content-wrapper {
        flex: 1;
        padding-right: 40px; /* Make room for the toggle indicator */
    }
    
    .product-card p {
        margin: 0.75rem 0 1rem;
        line-height: 1.5;
    }
    
    .card-link {
        display: inline-block;
        background: var(--accent-color);
        color: white;
        padding: 0.75rem 1.25rem;
        border-radius: 4px;
        font-weight: 500;
        text-align: center;
        width: 100%;
        text-decoration: none;
    }
    
    /* Accordion style for product lineup */
    .product-accordion .product-card {
        margin-bottom: 1rem;
    }
    
    .product-accordion .product-card-front {
        cursor: pointer;
        padding: 1.25rem;
    }
    
    .product-accordion .product-card-back {
        display: none;
        padding: 1.25rem;
        border-top: 1px solid rgba(75, 111, 173, 0.15);
    }
    
    .product-accordion .product-card.active .product-card-back {
        display: block;
    }
    
    .product-accordion .toggle-indicator {
        width: 24px;
        height: 24px;
        position: absolute;
        top: 50%;
        right: 1.25rem;
        transform: translateY(-50%);
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: rgba(75, 111, 173, 0.15);
        border-radius: 50%;
    }
    
    .product-accordion .toggle-indicator:before,
    .product-accordion .toggle-indicator:after {
        content: '';
        position: absolute;
        background-color: var(--accent-light);
        transition: transform 0.3s ease;
    }
    
    .product-accordion .toggle-indicator:before {
        width: 2px;
        height: 12px;
        top: 6px;
        left: 11px;
    }
    
    .product-accordion .toggle-indicator:after {
        width: 12px;
        height: 2px;
        top: 11px;
        left: 6px;
    }
    
    .product-accordion .product-card.active .toggle-indicator {
        background-color: rgba(75, 111, 173, 0.3);
    }
    
    .product-accordion .product-card.active .toggle-indicator:before {
        transform: rotate(90deg);
    }
}

/* Small Mobile Styles */
@media screen and (max-width: 576px) {
    .container {
        padding: 0 1rem;
    }
    
    /* Further reduce text sizes */
    h1 {
        font-size: 1.8rem !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
    
    h3 {
        font-size: 1.2rem !important;
    }
    
    p {
        font-size: 0.95rem;
    }
    
    /* Adjust header padding */
    .header-content {
        padding: 3rem 0;
    }
    
    /* Ensure buttons are properly sized */
    .cta-button, .btn-primary, .learn-more-btn {
        width: 100%;
        text-align: center;
        margin-bottom: 0.75rem;
    }
    
    /* Optimize tabs for small screens */
    .tab-btn {
        flex: 1 1 auto;
        text-align: center;
        font-size: 0.8rem;
        padding: 0.6rem 0.5rem;
    }
    
    /* Adjust modal close button */
    .close-modal {
        top: 0.5rem;
        right: 0.5rem;
    }
    
    /* Hide scrollbar on diagrams overflow */
    .specs-table-container::-webkit-scrollbar {
        height: 4px;
    }
    
    /* Optimize image sizes */
    .product-image img, .floating-img {
        max-width: 90%;
        margin: 0 auto;
    }
    
    /* Further optimize product cards */
    .product-card-front {
        padding: 1rem 0.875rem;
    }
    
    .product-card-back {
        padding: 1rem 0.875rem;
    }
    
    .product-card h3 {
        font-size: 1.1rem;
    }
    
    .product-tag {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Fix spacing on very small screens */
    .card-icon {
        width: 32px;
        height: 32px;
        margin-right: 0.75rem;
    }
    
    .card-icon svg {
        width: 32px;
        height: 32px;
    }
    
    .product-accordion .toggle-indicator {
        right: 0.875rem;
        width: 20px;
        height: 20px;
    }
    
    .product-accordion .toggle-indicator:before {
        height: 10px;
        top: 5px;
        left: 9px;
    }
    
    .product-accordion .toggle-indicator:after {
        width: 10px;
        top: 9px;
        left: 5px;
    }
    
    .product-card-front .content-wrapper {
        padding-right: 30px;
    }
    
    .product-accordion .product-card-front {
        padding: 1rem 0.875rem;
    }
    
    /* Further optimize architecture diagram for small screens */
    .layer-box {
        width: 100%;
        padding: 1.25rem 1rem;
        margin: 0 0 1.5rem 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        background-color: rgba(26, 34, 56, 0.95);
        height: 160px; /* Fixed height for small screens */
    }
    
    .layer-box span {
        font-size: 1.1rem;
        margin-bottom: 0.6rem;
        padding-left: 0;
        line-height: 1.2;
    }
    
    .layer-description {
        font-size: 0.9rem;
        line-height: 1.4;
        padding-left: 0;
        max-width: 100%;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
    }
    
    .architecture-diagram {
        padding: 0;
        margin-top: 0.75rem;
    }
    
    .architecture-section {
        padding: 2.5rem 0;
    }
    
    .diagram-container {
        width: 100%;
    }
}

/* Prevent horizontal scrolling */
body {
    overflow-x: hidden;
    width: 100%;
}

/* Improve touch experience on mobile devices */
a, button, .menu-toggle, .tab-btn {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Fix video background for mobile */
@media screen and (max-width: 768px) {
    .video-background video {
        object-position: center;
    }
}

/* Make sure images are responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Reduce animation for users who prefer 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;
    }
    
    .reveal-on-scroll, .reveal-text, .floating-img {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Fix viewport issues on iOS */
@supports (-webkit-touch-callout: none) {
    .parallax-section {
        background-attachment: scroll;
    }
}

/* Improve accessibility */
.nav-links a:focus, .cta-button:focus, button:focus {
    outline: 2px solid var(--accent-light);
    outline-offset: 2px;
}

/* Optimize navigation menu for screen readers */
.menu-toggle {
    position: relative;
}

/* Fix nav menu scroll issues */
body.menu-open {
    overflow: hidden;
} 