/* ===== TORC POWER - Enhanced Responsive CSS ===== */
/* Optimized for all devices with perfect spacing */

@media (max-width: 1400px) {
    .container {
        max-width: 1140px;
    }
    
    .mega-menu {
        width: 1100px;
        left: -100px;
    }
}

@media (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
    
    h1 { 
        font-size: 3rem; 
        line-height: 1.1;
    }
    
    h2 { 
        font-size: 2.25rem; 
        line-height: 1.2;
    }
    
    h3 { 
        font-size: 1.5rem; 
        line-height: 1.3;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
    
    .mega-menu {
        width: 900px;
        left: -100px;
    }
    
    .mega-menu-grid {
        gap: var(--space-lg);
    }
    
    .pillars-grid,
    .values-grid,
    .products-grid,
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .industry-solutions-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-lg);
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 720px;
        padding: 0 var(--space-lg);
    }
    
    h1 { 
        font-size: 2.75rem; 
        margin-bottom: var(--space-md);
    }
    
    h2 { 
        font-size: 2rem; 
        margin-bottom: var(--space-md);
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-description {
        font-size: 1.125rem;
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
    
    .mega-menu {
        width: 100%;
        left: 0;
        border-radius: 0;
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        padding: 0;
        box-shadow: none;
        background: transparent;
    }
    
    .mega-menu.active {
        display: block;
    }
    
    .mega-menu-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    .mega-menu-container {
        padding: var(--space-md) 0;
    }
    
    .product-category {
        margin-bottom: var(--space-lg);
    }
    
    .product-category:last-child {
        margin-bottom: 0;
    }
    
    .tab-content-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
    
    .tab-image .image-placeholder {
        height: 300px;
        order: -1;
    }
    
    .contact-grid,
    .about-grid,
    .pdf-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
    
    .mission-vision {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    .values-grid {
        gap: var(--space-lg);
    }
}

@media (max-width: 768px) {
    :root {
        --space-xs: 0.5rem;
        --space-sm: 0.75rem;
        --space-md: 1.25rem;
        --space-lg: 2rem;
        --space-xl: 3rem;
        --space-xxl: 4rem;
    }
    
    h1 { 
        font-size: 2.5rem; 
        line-height: 1.1;
    }
    
    h2 { 
        font-size: 1.75rem; 
        line-height: 1.2;
    }
    
    h3 { 
        font-size: 1.375rem; 
        line-height: 1.3;
    }
    
    .lead-text {
        font-size: 1.125rem;
    }
    
    .section-header {
        margin-bottom: var(--space-xl);
    }
    
    .section-title {
        margin-bottom: var(--space-sm);
    }
    
    .section-description {
        font-size: 1rem;
        margin-top: var(--space-md);
    }
    
    .hero {
        height: auto;
        min-height: auto;
        padding: 100px 0 var(--space-xxl);
    }
    
    .hero-title {
        font-size: 2.5rem;
        margin-bottom: var(--space-md);
    }
    
    .hero-description {
        font-size: 1.125rem;
        margin-bottom: var(--space-xl);
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    .hero-value-props {
        gap: var(--space-lg);
        justify-content: center;
    }
    
    .hero-stats {
        gap: var(--space-md);
    }
    
    .stat-card {
        padding: var(--space-lg);
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    /* Mobile Navigation */
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        background: var(--pure-white);
        flex-direction: column;
        align-items: stretch;
        padding: var(--space-xl);
        box-shadow: var(--shadow-xl);
        transition: left var(--transition-normal);
        z-index: var(--z-fixed);
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu li {
        width: 100%;
    }
    
    .nav-menu a {
        display: flex;
        padding: var(--space-md) 0;
        border-bottom: 1px solid var(--light-steel);
        width: 100%;
        font-size: 1rem;
    }
    
    .nav-menu a:last-child {
        border-bottom: none;
    }
    
    .nav-menu a i {
        margin-left: auto;
        transition: transform var(--transition-fast);
    }
    
    .nav-menu a.active i {
        transform: rotate(180deg);
    }
    
    .nav-cta {
        margin-top: var(--space-md);
    }
    
    .nav-cta .btn-primary {
        width: 100%;
        justify-content: center;
    }
    
    /* Enhanced Mega Menu for Mobile */
    .mega-menu-parent > a {
        justify-content: space-between;
    }
    
    .mega-menu {
        padding-left: var(--space-md);
        border-left: 3px solid var(--light-steel);
        margin: var(--space-sm) 0 var(--space-md);
    }
    
    .mega-menu-container {
        padding: var(--space-md) 0;
    }
    
    .product-category h3 {
        font-size: 1rem;
        margin-bottom: var(--space-md);
    }
    
    .product-link {
        padding: var(--space-sm);
        font-size: 0.95rem;
    }
    
    /* Tab System for Mobile */
    .tab-buttons {
        flex-direction: column;
        background: var(--pure-white);
        border-radius: var(--radius-lg);
        overflow: hidden;
        box-shadow: var(--shadow-md);
    }
    
    .tab-button {
        width: 100%;
        text-align: left;
        padding: var(--space-lg);
        border-right: none;
        border-bottom: 1px solid var(--light-steel);
        color: var(--steel-gray);
        background: var(--pure-white);
    }
    
    .tab-button:last-child {
        border-bottom: none;
    }
    
    .tab-button.active {
        color: var(--primary-blue);
        background: var(--light-steel);
    }
    
    .tab-button.active::after {
        left: 0;
        width: 5px;
        height: 100%;
        background: var(--gradient-energy);
    }
    
    .tab-content {
        padding: var(--space-xl) var(--space-lg);
    }
    
    /* Solution Stack */
    .pillars-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .pillar-card {
        padding: var(--space-lg);
    }
    
    .pillar-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    /* Products & Services */
    .products-grid,
    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .product-item,
    .service-card {
        padding: var(--space-lg);
    }
    
    .product-image {
        height: 200px;
    }
    
    /* CTA Section */
    .cta-buttons {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .cta-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: var(--space-md);
    }
    
    .footer-legal {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    /* Page Specific */
    .page-hero {
        padding: 8rem 0 var(--space-xl);
    }
    
    .page-title {
        font-size: 2.5rem;
    }
    
    .page-subtitle {
        font-size: 1.125rem;
    }
    
    .about-image .image-placeholder {
        height: 300px;
        font-size: 4rem;
    }
    
    .about-image .image-placeholder p {
        font-size: 1.5rem;
    }
    
    .values-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .value-card {
        padding: var(--space-lg);
    }
    
    .value-icon {
        width: 70px;
        height: 70px;
        font-size: 1.75rem;
    }
    
    /* Scroll Indicator */
    .scroll-indicator {
        display: none;
    }
    
    /* Video Fallback */
    .hero-video-container video {
        display: none;
    }
    
    .hero-video-container .video-fallback {
        display: block;
        width: 100%;
        height: 100%;
        background-size: cover;
        background-position: center;
        background-color: var(--primary-dark);
    }
}

@media (max-width: 576px) {
    :root {
        --space-xs: 0.375rem;
        --space-sm: 0.625rem;
        --space-md: 1rem;
        --space-lg: 1.5rem;
        --space-xl: 2.5rem;
        --space-xxl: 3rem;
    }
    
    .container {
        padding: 0 var(--space-md);
    }
    
    h1 { 
        font-size: 2.25rem; 
        line-height: 1.1;
    }
    
    h2 { 
        font-size: 1.625rem; 
        line-height: 1.2;
    }
    
    h3 { 
        font-size: 1.25rem; 
        line-height: 1.3;
    }
    
    h5 {
        font-size: 0.875rem;
        letter-spacing: 1px;
    }
    
    section {
        padding: var(--space-xl) 0;
    }
    
    .hero {
        padding: 90px 0 var(--space-xl);
    }
    
    .hero-title {
        font-size: 2.25rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero-stats {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    .stat-card {
        padding: var(--space-lg);
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
        min-height: 44px;
    }
    
    .btn-large {
        padding: 0.875rem 1.75rem;
        font-size: 1rem;
    }
    
    /* Navigation */
    .navbar {
        padding: 1rem 0;
    }
    
    .logo-emblem {
        width: 40px;
        height: 40px;
    }
    
    .logo-main {
        font-size: 1.25rem;
    }
    
    .logo-tagline {
        font-size: 0.7rem;
    }
    
    /* Mega Menu */
    .product-link {
        padding: 0.75rem;
        min-height: 44px;
    }
    
    /* Tab System */
    .tab-button {
        padding: var(--space-md);
        font-size: 1rem;
    }
    
    .tab-content {
        padding: var(--space-lg);
    }
    
    /* Cards */
    .pillar-card,
    .service-card,
    .product-item,
    .value-card,
    .mv-card {
        padding: var(--space-lg);
    }
    
    .pillar-icon,
    .service-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
        margin-bottom: var(--space-md);
    }
    
    .value-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    /* Forms */
    input, select, textarea {
        padding: 0.75rem;
        font-size: 0.95rem;
    }
    
    /* Page Hero */
    .page-hero {
        padding: 7rem 0 var(--space-lg);
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    /* About Page */
    .about-image .image-placeholder {
        height: 250px;
        font-size: 3rem;
    }
    
    .about-image .image-placeholder p {
        font-size: 1.25rem;
    }
    
    /* Contact Page */
    .contact-form {
        padding: var(--space-lg);
    }
    
    .contact-item {
        flex-direction: column;
        gap: var(--space-sm);
        margin-bottom: var(--space-lg);
    }
    
    .contact-item i {
        margin-top: 0;
    }
    
    /* Map */
    .map-container {
        height: 300px;
    }
    
    .map-placeholder {
        font-size: 2rem;
    }
    
    .map-placeholder p {
        font-size: 1.25rem;
    }
    
    .map-placeholder small {
        font-size: 0.875rem;
    }
}

@media (max-width: 375px) {
    h1 { 
        font-size: 2rem; 
    }
    
    h2 { 
        font-size: 1.5rem; 
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .container {
        padding: 0 var(--space-sm);
    }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
    .btn:hover::before {
        animation: none;
    }
    
    .nav-menu a:hover,
    .product-link:hover,
    .pillar-link:hover,
    .case-study-link:hover {
        transform: none;
    }
    
    .pillar-card:hover,
    .industry-solution-card:hover,
    .product-item:hover,
    .service-card:hover,
    .value-card:hover,
    .mv-card:hover {
        transform: none;
    }
    
    .tab-button:hover {
        background: none;
    }
    
    /* Improve touch targets */
    .btn,
    .product-link,
    .nav-menu a,
    .filter-btn {
        min-height: 44px;
    }
    
    input, select, textarea {
        font-size: 16px; /* Prevent iOS zoom on focus */
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --industrial-gray: #f8fafc;
        --steel-gray: #cbd5e1;
        --light-steel: #1e293b;
        --pure-white: #0f172a;
        --primary-blue: #60a5fa;
        --primary-dark: #93c5fd;
        --safety-orange: #fb923c;
    }
    
    body {
        background: #0f172a;
        color: #cbd5e1;
    }
    
    .main-header {
        background: rgba(15, 23, 42, 0.98);
    }
    
    .hero-title,
    .page-title,
    .section-title,
    h1, h2, h3, h4, h5, h6 {
        color: #f8fafc;
    }
    
    .logo-main {
        color: #f8fafc;
    }
    
    .nav-menu a {
        color: #cbd5e1;
    }
    
    .solution-stack {
        background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    }
    
    .pillar-card,
    .service-card,
    .product-item,
    .value-card,
    .mv-card,
    .industry-solution-card,
    .pdf-card {
        background: #1e293b;
        border-color: #334155;
    }
    
    .contact-form {
        background: #1e293b;
        border-color: #334155;
    }
    
    input, select, textarea {
        background: #334155;
        border-color: #475569;
        color: #cbd5e1;
    }
    
    input:focus, select:focus, textarea:focus {
        border-color: #60a5fa;
        box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
    }
}

/* ===== PRINT OPTIMIZATIONS ===== */
@media print {
    @page {
        margin: 2cm;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: #fff !important;
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    .main-header,
    .hero,
    .cta-section,
    .main-footer,
    .btn,
    .hamburger,
    .scroll-indicator,
    .video-overlay,
    .social-links,
    .hero-buttons,
    .cta-buttons {
        display: none !important;
    }
    
    section {
        padding: 20pt 0 !important;
        margin: 0 !important;
        page-break-inside: avoid;
    }
    
    h1, h2, h3, h4, h5, h6 {
        color: #000 !important;
        page-break-after: avoid;
    }
    
    a {
        color: #000 !important;
        text-decoration: underline !important;
    }
    
    a[href^="http"]::after {
        content: " (" attr(href) ")";
    }
    
    .logo-emblem {
        background: #000 !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .logo-circle {
        background: #000 !important;
    }
    
    .logo-orange-core {
        background: #666 !important;
    }
    
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    .pillars-grid,
    .values-grid,
    .products-grid,
    .services-grid,
    .industry-solutions-grid,
    .pdf-grid,
    .contact-grid,
    .about-grid,
    .mission-vision {
        display: block !important;
    }
    
    .pillar-card,
    .value-card,
    .product-item,
    .service-card,
    .industry-solution-card,
    .pdf-card,
    .mv-card {
        page-break-inside: avoid;
        margin-bottom: 20pt !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
    
    .tab-content {
        display: block !important;
    }
    
    .tab-pane {
        display: block !important;
        page-break-inside: avoid;
    }
}

/* ===== HIGH CONTRAST MODE SUPPORT ===== */
@media (prefers-contrast: high) {
    :root {
        --primary-blue: #0000ff;
        --safety-orange: #ff8c00;
        --success-green: #008000;
        --danger-red: #ff0000;
    }
    
    .btn-primary {
        border: 2px solid #000;
    }
    
    .btn-secondary {
        border: 2px solid var(--primary-blue);
    }
    
    .nav-menu a.active::after {
        height: 3px;
    }
    
    .tab-button.active::after {
        height: 4px;
    }
}

/* ===== REDUCED MOTION SUPPORT ===== */
@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;
    }
    
    .logo-orange-core,
    .logo-swirl,
    .logo-swirl-2 {
        animation: none !important;
    }
    
    .btn::before {
        animation: none !important;
    }
    
    .scroll-indicator,
    .wheel {
        animation: none !important;
    }
    
    .stat-number {
        transition: none !important;
    }
}