/* ===== COMPREHENSIVE RESPONSIVE DESIGN ===== */

/* Base responsive utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Prevent horizontal overflow on all elements */
* {
    box-sizing: border-box;
    max-width: 100%;
}

.nav-get-started-mobile,
.nav-download-mobile {
    display: none;
}

/* ===== EXTRA LARGE SCREENS (1400px and up) ===== */
@media screen and (min-width: 1400px) {
    .container {
        max-width: 1400px;
        padding: 0 40px;
    }

    .welcome-hero-title {
        font-size: 3.8rem;
    }

    .brand-name {
        font-size: 2.8rem;
    }

    .section-title {
        font-size: 3.2rem;
    }

    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2.5rem;
    }

    .industries-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ===== LARGE DESKTOPS (1200px - 1399px) ===== */
@media screen and (min-width: 1200px) and (max-width: 1399px) {
    .container {
        max-width: 1200px;
        padding: 0 30px;
    }

    .welcome-hero-title {
        font-size: 3.4rem;
    }

    .brand-name {
        font-size: 2.4rem;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }

    .industries-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===== MEDIUM DESKTOPS (992px - 1199px) ===== */
@media screen and (min-width: 992px) and (max-width: 1199px) {
    .container {
        padding: 0 25px;
    }

    .welcome-hero-title {
        font-size: 3rem;
    }

    .brand-name {
        font-size: 2.2rem;
    }

    .section-title {
        font-size: 2.6rem;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.8rem;
    }

    .industries-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }

    .image-carousel {
        height: 380px;
    }

    .feature-highlights {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== SMALL DESKTOPS & LARGE TABLETS (768px - 991px) ===== */
@media screen and (min-width: 768px) and (max-width: 991px) {
    .container {
        padding: 0 20px;
    }

    /* Navigation adjustments */
    .nav-list {
        gap: 1.2rem;
    }

    .nav-link {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .nav-get-started {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    /* Hero section */
    .welcome-hero {
        padding: 100px 0 60px;
    }

    .welcome-hero-content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        align-items: center;
    }

    .welcome-hero-title {
        font-size: 2.6rem;
    }

    .brand-name {
        font-size: 2rem;
    }

    .brand-description {
        font-size: 1rem;
    }

    .image-carousel {
        height: 350px;
    }

    .hero-cta {
        justify-content: flex-start;
    }

    /* Feature highlights */
    .feature-highlights {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    /* News and content grids */
    .news-updates-grid,
    .welcome-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    /* Products and industries */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .industries-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    /* Contact section */
    .contact-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .form-row {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    /* Section titles */
    .section-title {
        font-size: 2.2rem;
    }
}

/* ===== TABLETS (576px - 767px) ===== */
@media screen and (min-width: 576px) and (max-width: 767px) {
    .container {
        padding: 0 15px;
    }

    /* Header/Nav styles removed to avoid duplication - handled in includes/header.php */

    .nav-get-started-mobile,
    .nav-download-mobile {
        display: block !important;
        width: 100%;
        max-width: 300px;
        margin: 0.5rem auto 0;
    }

    .nav-get-started-mobile .nav-login {
        width: 100%;
        display: block;
        background: #000;
        color: #fff;
        border-radius: 10px;
    }

    .nav-download-mobile-btn {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
        color: #ffffff !important;
        border-radius: 12px;
        box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4), 0 0 0 0 rgba(99, 102, 241, 0.5);
        font-weight: 700;
        font-size: 0.875rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        padding: 0.85rem 1.5rem;
        border: 2px solid transparent;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        overflow: hidden;
        text-decoration: none;
    }

    .nav-download-mobile-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        transition: left 0.5s ease;
    }

    .nav-download-mobile-btn:hover::before {
        left: 100%;
    }

    .nav-download-mobile-btn:hover {
        transform: translateY(-3px) scale(1.02);
        box-shadow: 0 10px 30px rgba(99, 102, 241, 0.5), 0 0 20px rgba(6, 182, 212, 0.4);
        filter: brightness(1.15);
        border-color: rgba(255, 255, 255, 0.3);
    }

    .nav-download-mobile-btn i:first-child {
        font-size: 1.1rem;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    }

    .nav-download-mobile-btn i:last-child {
        font-size: 0.85rem;
        opacity: 0.9;
        transition: transform 0.3s ease;
    }

    .nav-download-mobile-btn:hover i:last-child {
        transform: translateY(2px);
    }

    /* Hero section */
    .welcome-hero {
        min-height: 80vh;
        padding: 100px 0 40px;
    }

    .welcome-hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .welcome-hero-text {
        text-align: center;
        order: 1;
    }

    .image-carousel {
        height: 320px;
        margin: 0 auto;
        max-width: 100%;
        order: 2;
    }

    .welcome-hero-title {
        font-size: 2.4rem;
        line-height: 1.2;
    }

    .brand-name {
        font-size: 1.8rem;
    }

    .brand-description {
        font-size: 1rem;
    }

    .title-subtitle {
        font-size: 0.95rem;
        letter-spacing: 1px;
    }

    .hero-cta {
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .hero-cta .btn {
        min-width: 160px;
        padding: 12px 20px;
    }

    /* Feature highlights */
    .feature-highlights {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .feature-item {
        padding: 1.5rem;
    }

    /* Sections spacing */
    .news-updates-section,
    .products-section,
    .industries-section,
    .contact-section {
        padding: 3.5rem 0;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    /* Grids - stack vertically */
    .news-updates-grid,
    .welcome-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
    }

    .product-card {
        padding: 1.5rem;
    }

    .product-placeholder {
        width: 130px;
        height: 130px;
    }

    .industries-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
    }

    .industry-card {
        padding: 1.5rem;
    }

    .industry-icon {
        font-size: 2.2rem;
    }

    /* Contact section */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-info {
        order: 2;
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .contact-form-container {
        order: 1;
        padding: 2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-actions {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .btn {
        width: 100%;
        max-width: 250px;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        text-align: left;
    }

    /* ===== ARMOUR RINGS RESPONSIVE ===== */
    .ar-steps-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ring-card:nth-child(3),
    .ring-card:nth-child(4) {
        grid-column: span 2;
    }

    .ar-stats-banner {
        padding: 2rem;
        flex-wrap: wrap;
        gap: 2rem;
        justify-content: center;
    }

    .stat-item-new {
        width: 45%;
    }
}

/* ===== MOBILE PHONES (up to 575px) ===== */
@media screen and (max-width: 575px) {
    .container {
        padding: 0 12px;
    }

    /* ARMOUR RINGS MOBILE */
    .armour-rings-new {
        padding: 4rem 0;
    }

    .ar-main-title {
        font-size: 2.2rem;
    }

    .ar-section-header {
        margin-bottom: 3rem;
    }

    .ar-steps-grid {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        margin-bottom: 3rem;
    }

    .ring-card,
    .step-image-card {
        width: 100%;
        grid-column: auto !important;
    }

    .ring-number-bg {
        font-size: 5rem;
        right: 10px;
        top: 0;
    }

    .step-image-card {
        min-height: 250px;
    }

    .ar-stats-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem;
        gap: 2rem;
    }

    .stat-item-new {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
        padding-bottom: 1rem;
    }

    .stat-item-new:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .video-info-overlay {
        bottom: 15px;
        left: 15px;
        right: 15px;
        padding: 8px 15px;
        justify-content: center;
    }

    .video-play-btn {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .video-info-overlay span {
        font-size: 0.8rem;
    }

    /* Header/Nav styles removed to avoid duplication - handled in includes/header.php */

    /* Hero section */
    .welcome-hero {
        min-height: 85vh;
        padding: 80px 0 30px;
    }

    .welcome-hero-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }

    .welcome-hero-title {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }

    .title-subtitle {
        font-size: 0.9rem;
        letter-spacing: 0.8px;
        margin-top: 0.3rem;
    }

    .brand-name {
        font-size: 1.6rem;
        margin-bottom: 0.3rem;
    }

    .brand-description {
        font-size: 0.95rem;
        margin-bottom: 0.3rem;
    }

    .brand-subtitle {
        font-size: 0.85rem;
    }

    .welcome-hero-description p {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .image-carousel {
        height: 280px;
        margin: 0 auto;
        max-width: 100%;
    }

    .slide-image i {
        font-size: 2.5rem;
    }

    .slide-image h3 {
        font-size: 1.3rem;
        margin-bottom: 0.8rem;
    }

    .slide-image p {
        font-size: 0.85rem;
        max-width: 250px;
    }

    .slide-content {
        padding: 1.5rem;
        margin: 1.5rem;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
        margin-top: 1.5rem;
    }

    .hero-cta .btn {
        width: 100%;
        max-width: 220px;
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    /* Feature highlights */
    .feature-highlights {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .feature-item {
        padding: 1.3rem;
    }

    .feature-item .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    .feature-item h3 {
        font-size: 1rem;
    }

    .feature-item p {
        font-size: 0.85rem;
    }

    /* Sections */
    .news-updates-section,
    .products-section,
    .industries-section,
    .contact-section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 1.7rem;
        margin-bottom: 0.8rem;
        line-height: 1.3;
    }

    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    /* News and content grids */
    .news-updates-grid,
    .welcome-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .news-updates,
    .armour-rings {
        padding: 1.5rem;
    }

    .news-updates h3,
    .armour-rings h3 {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }

    .news-ticker {
        height: 250px;
    }

    .news-item {
        margin-bottom: 1.5rem;
        padding: 0.8rem;
    }

    .news-date {
        font-size: 0.8rem;
    }

    .news-item p {
        font-size: 0.85rem;
    }

    .concept-img {
        max-height: 250px;
    }

    /* Products */
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .product-card {
        padding: 1.3rem;
    }

    .product-card h3 {
        font-size: 1.1rem;
        line-height: 1.3;
    }

    .product-placeholder {
        width: 110px;
        height: 110px;
        font-size: 0.8rem;
    }

    /* Industries */
    .industries-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .industry-card {
        padding: 1.2rem;
    }

    .industry-icon {
        font-size: 2rem;
        margin-bottom: 0.8rem;
    }

    .industry-card h3 {
        font-size: 0.95rem;
        line-height: 1.3;
    }

    /* Contact section */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .contact-subtitle {
        font-size: 1rem;
        margin-top: 0.8rem;
    }

    .contact-info {
        order: 2;
        gap: 1rem;
    }

    .info-card {
        padding: 1.2rem;
        gap: 1rem;
    }

    .info-icon {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .info-content h3 {
        font-size: 1.1rem;
        margin-bottom: 0.3rem;
    }

    .info-content p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .contact-form-container {
        order: 1;
        padding: 1.5rem;
    }

    .form-header h3 {
        font-size: 1.5rem;
        margin-bottom: 0.3rem;
    }

    .form-header p {
        font-size: 0.9rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .form-group {
        margin-bottom: 0.8rem;
    }

    .form-group label {
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.7rem;
        font-size: 0.9rem;
    }

    .form-group textarea {
        min-height: 80px;
    }

    .form-actions {
        flex-direction: column;
        align-items: center;
        margin-top: 1rem;
        gap: 0.8rem;
    }

    .form-actions .btn {
        width: 100%;
        max-width: 280px;
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    /* Footer */
    .footer {
        padding: 2.5rem 0 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }

    .footer-section h3 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }

    .footer-section ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.8rem;
    }

    .footer-section ul li {
        margin-bottom: 0;
    }

    .footer-section a {
        font-size: 0.9rem;
    }

    .social-links {
        justify-content: center;
        gap: 0.8rem;
    }

    .social-links a {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    .footer-bottom {
        font-size: 0.8rem;
        padding-top: 0.8rem;
        line-height: 1.5;
    }
}

/* ===== EXTRA SMALL DEVICES (up to 360px) ===== */
@media screen and (max-width: 360px) {
    .container {
        padding: 0 10px;
    }

    .welcome-hero-title {
        font-size: 1.7rem;
    }

    .brand-name {
        font-size: 1.4rem;
    }

    .image-carousel {
        height: 240px;
    }

    .slide-image i {
        font-size: 2rem;
    }

    .slide-image h3 {
        font-size: 1.1rem;
    }

    .slide-image p {
        font-size: 0.8rem;
        max-width: 200px;
    }

    .slide-content {
        padding: 1.2rem;
        margin: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .product-card,
    .industry-card {
        padding: 1rem;
    }

    .industries-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .feature-item {
        padding: 1rem;
    }

    .nav-link {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
        max-width: 250px;
    }

    .hero-cta .btn {
        max-width: 200px;
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .form-actions .btn {
        max-width: 250px;
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
    }
}

/* ===== LANDSCAPE ORIENTATION FIXES ===== */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .welcome-hero {
        min-height: 100vh;
        padding: 1rem 0;
    }

    .welcome-hero-content {
        gap: 1.5rem;
    }

    .welcome-hero-title {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .brand-name {
        font-size: 1.6rem;
        margin-bottom: 0.3rem;
    }

    .image-carousel {
        height: 200px;
    }

    .hero-cta {
        margin-top: 1rem;
    }

    .hero-cta .btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
}

/* ===== HIGH DPI DISPLAYS ===== */
@media screen and (-webkit-min-device-pixel-ratio: 2),
screen and (min-resolution: 192dpi) {
    .hero-background {
        background-size: 20px 20px;
    }

    .slide-content {
        backdrop-filter: blur(15px);
    }
}

/* ===== ACCESSIBILITY & MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .carousel-slide {
        transition: none;
    }

    .news-scroll {
        animation: none;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    .header {
        background: rgba(26, 26, 26, 0.95);
    }

    /* Ensure desktop nav stays transparent in dark mode */
    .nav-menu {
        background: transparent;
    }

    .nav-link {
        color: #e0e0e0;
    }

    .nav-link:hover,
    .nav-link.active {
        color: #64b5f6;
        background: rgba(100, 181, 246, 0.1);
    }

    .hamburger span {
        background: #e0e0e0;
    }
}

/* In dark mode, only the mobile slide-in menu should have a dark glassy background */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    .nav-menu {
        background: rgba(26, 26, 26, 0.75);
        backdrop-filter: blur(25px) saturate(180%);
        -webkit-backdrop-filter: blur(25px) saturate(180%);
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    .btn-primary {
        background: #000;
        border: 2px solid #000;
        color: #fff;
    }

    .btn-primary:hover {
        background: #fff;
        color: #000;
        border-color: #000;
    }

    .btn-secondary {
        border: 2px solid #000;
        color: #000;
    }

    .btn-secondary:hover {
        background: #000;
        color: #fff;
    }

    .nav-link {
        border: 1px solid transparent;
    }

    .nav-link:hover,
    .nav-link.active {
        border-color: #000;
    }
}

/* ===== FOCUS STYLES FOR ACCESSIBILITY ===== */
.nav-link:focus,
.btn:focus,
input:focus,
textarea:focus,
select:focus,
button:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }

    .header,
    .hamburger,
    .btn,
    .contact-section,
    .footer,
    .nav-menu {
        display: none;
    }

    .welcome-hero {
        min-height: auto;
        padding: 2rem 0;
        background: white !important;
    }

    .section-title {
        color: black !important;
        font-size: 1.5rem;
    }

    .product-card,
    .industry-card {
        border: 1px solid #ccc;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .container {
        max-width: none;
        padding: 0;
    }

    .products-grid,
    .industries-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* ===== SMOOTH SCROLLING ===== */
@supports (scroll-behavior: smooth) {
    html {
        scroll-behavior: smooth;
    }
}

/* ===== FINAL OVERFLOW PREVENTION ===== */
.welcome-hero,
.news-updates-section,
.products-section,
.industries-section,
.contact-section,
.footer {
    width: 100%;
    overflow-x: hidden;
}

/* Ensure all grid containers don't overflow */
.products-grid,
.industries-grid,
.feature-highlights,
.news-updates-grid,
.welcome-grid,
.contact-grid,
.footer-content {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* Final safety net for any remaining overflow issues */
body>* {
    max-width: 100vw;
    overflow-x: hidden;
}