/* Responsive Design for Nirvana Tech Website */

/* Tablet Styles (768px - 1024px) */
@media screen and (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
        max-width: 100%;
        padding: 0 15px !important;
        box-sizing: border-box;
    }
    
    .hero-visual {
        order: -1;
    }
    
    .solutions-grid {
        grid-template-columns: 1fr;
    }
    
    .solution-card.featured {
        transform: none;
    }
    
    .challenge-solution {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .results-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

/* Mobile Landscape (481px - 767px) */
@media screen and (max-width: 767px) {
    /* Navigation Mobile */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
        gap: 1rem;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    /* Typography adjustments */
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }
    
    /* Hero Section Mobile */
    .hero {
        padding: 150px 0 60px !important;
        min-height: auto;
    }
    
    .hero::before,
    .hero::after {
        display: none;
    }
    
    .connectivity-demo {
        transform: none;
        max-width: 380px;
    }
    
    .connectivity-demo:hover {
        transform: translateY(-2px) scale(1.01);
    }
    
    .hero-stats {
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        width: 100%;
        max-width: 320px;
        margin: 2rem auto 0;
    }
    
    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
        font-size: 0.95rem;
        text-align: center;
    }
    
    /* Problem Grid Mobile */
    .problem-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Industries Grid Mobile */
    .industries-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .industry-card {
        max-width: 400px;
        margin: 0 auto;
    }
    
    /* Benefits Grid Mobile */
    .benefits-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Results Grid Mobile */
    .results-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .result-item {
        padding: 1rem;
    }
    
    .result-number {
        font-size: 2rem;
    }
    
    /* Form adjustments */
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .contact-form {
        padding: 2rem;
    }
    
    /* Quiz Mobile */
    .question-container {
        padding: 2rem;
    }
    
    .contact-form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .quiz-navigation {
        padding: 1.5rem 2rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    #prev-btn, #next-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Footer Mobile */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* Section padding adjustments */
    :root {
        --section-padding: 60px 0;
    }
    
    .case-study-content {
        padding: 2rem;
    }
    
    /* Carousel responsive */
    .carousel-navigation {
        gap: 1rem;
        margin-top: 1.5rem;
    }
    
    .carousel-btn {
        width: 45px;
        height: 45px;
    }
    
    .industry-badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
    
    .solution-card {
        padding: 2rem;
    }
    
    .industry-card {
        padding: 2rem;
    }
}

/* Mobile Portrait (320px - 480px) */
@media screen and (max-width: 480px) {
    /* Container padding */
    .container {
        padding: 0 15px;
    }
    
    /* Typography */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.3rem; }
    
    /* Navigation */
    .nav-container {
        padding: 0 15px;
    }
    
    .nav-logo h2 {
        font-size: 1.5rem;
    }
    
    /* Hero */
    .hero {
        padding: 140px 0 50px !important;
    }
    
    .hero-container {
        padding: 0 15px;
        gap: 2rem;
    }
    
    .hero-stats {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        max-width: 100%;
        margin: 2rem auto 0;
        padding: 0 10px;
        width: 100%;
    }
    
    .stat-item {
        display: flex;
        align-items: center;
        gap: 1rem;
        text-align: left;
        padding: 0.8rem;
        justify-content: center;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .stat-number {
        font-size: 1.5rem;
        margin-bottom: 0;
        flex-shrink: 0;
        min-width: 60px;
    }
    
    .connectivity-icons {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .connectivity-icon {
        font-size: 1.5rem;
        padding: 0.8rem;
    }
    
    .signal-bars {
        padding: 1.5rem 0;
        margin-bottom: 1.5rem;
        gap: 10px;
    }
    
    .bar {
        width: 14px;
    }
    
    .bar:nth-child(1) { height: 25px; }
    .bar:nth-child(2) { height: 35px; }
    .bar:nth-child(3) { height: 45px; }
    .bar:nth-child(4) { height: 55px; }
    .bar:nth-child(5) { height: 65px; }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .connectivity-demo {
        padding: 2rem;
    }
    
    /* Section headers */
    .section-header {
        margin-bottom: 2rem;
    }
    
    /* Cards */
    .problem-item,
    .solution-card,
    .industry-card {
        padding: 1.5rem;
    }
    
    .problem-icon,
    .industry-icon {
        font-size: 2.5rem;
    }
    
    .solution-icon {
        width: 60px;
        height: 60px;
    }
    
    .solution-icon i {
        font-size: 1.5rem;
    }
    
    /* Contact */
    .contact-form {
        padding: 1.5rem;
    }
    
    .contact-info {
        padding: 1rem;
    }
    
    /* Quiz */
    .question-container {
        padding: 1.5rem;
    }
    
    .contact-form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 1.5rem 0;
    }
    
    .customer-info {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    
    .quiz-navigation {
        padding: 1rem 1.5rem;
    }
    
    /* Case study */
    .case-study-content {
        padding: 1.5rem;
    }
    
    /* Carousel mobile */
    .carousel-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .carousel-dots {
        order: -1;
    }
    
    .challenge,
    .solution {
        padding: 1.5rem;
    }
    
    /* Footer */
    .footer {
        padding: 2rem 0 1rem;
    }
    
    /* Buttons */
    .btn {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
    
    /* Reduce section padding further */
    :root {
        --section-padding: 40px 0;
    }
}

/* Very Small Mobile (max-width: 320px) */
@media screen and (max-width: 320px) {
    .container {
        padding: 0 10px;
    }
    
    .nav-container {
        padding: 0 10px;
    }
    
    .hero-container {
        padding: 0 10px;
    }
    
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.6rem; }
    
    .connectivity-demo {
        padding: 1.5rem;
    }
    
    .problem-item,
    .solution-card,
    .industry-card,
    .contact-form,
    .question-container {
        padding: 1rem;
    }
    
    .case-study-content {
        padding: 1rem;
    }
    
    .industry-badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
    
    /* Captcha mobile styles */
    .captcha-container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .captcha-question {
        text-align: center;
        min-width: auto;
    }
    
    .captcha-container input {
        width: 100px !important;
        margin: 0 auto;
    }
    
    .captcha-refresh {
        align-self: center;
        width: 44px;
    }
    
    .case-study-content h3 {
        font-size: 1.2rem;
    }
    
    .challenge,
    .solution {
        padding: 1rem;
    }
    
    .result-number {
        font-size: 1.8rem;
    }
}

/* Landscape orientation adjustments */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 80px 0 40px;
    }
    
    .hero-container {
        gap: 2rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .connectivity-demo {
        padding: 1.5rem;
    }
}

/* Print styles */
@media print {
    .navbar,
    .hero-buttons,
    .quiz-section,
    .contact-section {
        display: none;
    }
    
    * {
        color: black !important;
        background: white !important;
    }
    
    .hero {
        padding: 20px 0;
        min-height: auto;
    }
    
    .section-padding {
        --section-padding: 20px 0;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --light-gray: #E0E0E0;
        --medium-gray: #707070;
    }
    
    .btn-secondary {
        border-width: 3px;
    }
    
    .nav-link:hover,
    .industry-link:hover {
        text-decoration: underline;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .bar.active {
        animation: none;
    }
}

/* Focus styles for accessibility */
@media (prefers-reduced-motion: no-preference) {
    .btn:focus,
    .nav-link:focus,
    .quiz-option:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }
}

/* Mobile Hero Graphics Fix */
@media screen and (max-width: 767px) {
    .hero {
        padding: 90px 0 50px;
    }
    
    .hero-container {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        padding: 0 20px;
        box-sizing: border-box;
    }
    
    .hero-content {
        padding-right: 0;
        width: 100%;
        max-width: 100%;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.8rem;
        line-height: 1.2;
        margin-bottom: 1rem;
        word-wrap: break-word;
        hyphens: auto;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        line-height: 1.4;
        margin-bottom: 1rem;
        padding-left: 0;
    }
    
    .hero-subtitle::before {
        display: none;
    }
    
    .hero-description {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
        max-width: 100%;
        word-wrap: break-word;
    }
    
    .hero-visual {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        padding: 1rem 0;
        display: flex;
        justify-content: center;
    }
    
    .connectivity-demo {
        width: 100% !important;
        max-width: 280px !important;
        margin: 0 auto !important;
        transform: none !important;
        padding: 1.5rem 1rem;
        box-sizing: border-box;
    }
    
    .connectivity-demo::before {
        display: none !important;
    }
    
    .connectivity-demo:hover {
        transform: translateY(-2px) !important;
    }
    
    .hero::before,
    .hero::after {
        display: none !important;
    }
    
    .signal-bars {
        gap: 8px;
        padding: 1rem 0;
    }
    
    .bar {
        width: 12px;
    }
    
    .connectivity-icons {
        gap: 0.8rem;
        margin-top: 1rem;
    }
    
    .connectivity-icon {
        font-size: 1.3rem;
        padding: 0.6rem;
    }
}

@media screen and (max-width: 480px) {
    .hero {
        padding: 80px 0 40px;
    }
    
    .hero-container {
        padding: 0 15px;
        gap: 2rem;
    }
    
    .hero-title {
        font-size: 2.2rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-description {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .hero-buttons {
        max-width: 280px;
        margin: 1.5rem auto 0;
    }
    
    .connectivity-demo {
        max-width: 260px !important;
        padding: 1.2rem 0.8rem;
    }
    
    .signal-bars {
        gap: 6px;
    }
    
    .bar {
        width: 10px;
    }
    
    .bar:nth-child(1) { height: 18px; }
    .bar:nth-child(2) { height: 24px; }
    .bar:nth-child(3) { height: 30px; }
    .bar:nth-child(4) { height: 36px; }
    .bar:nth-child(5) { height: 42px; }
}

/* Mobile Text Alignment and Overflow Fix */
@media screen and (max-width: 320px) {
    body {
        overflow-x: hidden !important;
    }
    
    .hero {
        padding: 70px 0 30px;
    }
    
    .hero-container {
        padding: 0 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    .hero-content {
        width: 100%;
        padding-right: 0 !important;
        text-align: center;
    }
    
    .hero-title {
        font-size: 1.9rem !important;
        line-height: 1.1;
        word-wrap: break-word;
        hyphens: auto;
    }
    
    .hero-subtitle {
        font-size: 0.95rem !important;
        padding-left: 0 !important;
    }
    
    .hero-subtitle::before {
        display: none !important;
    }
    
    .hero-description {
        font-size: 0.9rem !important;
        word-wrap: break-word;
    }
    
    .hero-buttons {
        max-width: 250px;
        margin: 1.5rem auto 0;
    }
    
    .hero-stats {
        padding: 0 5px;
        margin: 1.5rem auto 0;
    }
    
    .stat-item {
        max-width: 240px;
        gap: 0.8rem;
        padding: 0.5rem;
        margin: 0 auto;
    }
    
    .stat-number {
        font-size: 1.3rem;
        min-width: 50px;
    }
    
    .stat-label {
        font-size: 0.8rem;
        line-height: 1.2;
    }
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here if needed */
}