/* Responsive CSS for 무투스랩 Website */

/* Mobile Text Color Enhancement - 가독성 최적화 */
@media (max-width: 768px) {
    /* 모바일 가독성 최적화 */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        background-color: #ffffff !important;
    }
    
    /* 히어로 섹션은 파란색 배경에 흰색 텍스트 유지 */
    #home, 
    #home * {
        color: inherit !important;
    }
    
    #home h1,
    #home h1 * {
        color: white !important;
        text-shadow: none !important;
    }
    
    #home p,
    #home span,
    #home div {
        color: #dbeafe !important; /* blue-100 */
    }
    
    #home .text-blue-100,
    #home .text-blue-200,
    #home .text-blue-300,
    #home .text-white {
        color: inherit !important;
    }
    
    /* 모든 회색 배경을 흰색으로 변경 (히어로 제외) */
    section:not(#home).bg-gray-50,
    section:not(#home) .bg-gray-50,
    .bg-gray-100 {
        background-color: #ffffff !important;
    }
    
    /* 그라디언트 배경은 밝은 흰색으로 */
    .bg-gradient-to-br.from-gray-50,
    .bg-gradient-to-br.from-emerald-50,
    .bg-gradient-to-br.from-indigo-50,
    .bg-gradient-to-br.from-blue-50 {
        background: #ffffff !important;
    }
    
    /* 모든 제목 텍스트를 검은색으로 (히어로 섹션 제외) */
    body h1:not(#home h1):not(#home h1 *), 
    body h2:not(#home h2), 
    body h3:not(#home h3), 
    body h4:not(#home h4), 
    body h5:not(#home h5), 
    body h6:not(#home h6) {
        color: #000000 !important;
        font-weight: 800 !important;
        text-shadow: none;
    }
    
    /* 일반 텍스트를 검은색으로 (히어로 섹션 제외) */
    body p:not(#home p):not(#home p *),
    body span:not(#home span):not(#home span *):not(.bg-gradient-to-r):not(.text-transparent),
    body div:not(#home div):not(#home div *):not(.bg-gradient-to-r),
    body li:not(#home li) {
        color: #000000 !important;
        font-weight: 500 !important;
    }
    
    /* 링크는 파란색 유지 (히어로 섹션 제외) */
    body a:not(#home a):not(#home a *):not(.btn):not(.bg-gradient-to-r) {
        color: #1e40af !important;
        font-weight: 600 !important;
    }
    
    /* 회색 계열 텍스트를 검은색으로 강화 */
    .text-gray-600:not(#home .text-gray-600),
    .text-gray-700:not(#home .text-gray-700),
    .text-gray-500:not(#home .text-gray-500),
    .text-gray-800:not(#home .text-gray-800),
    .text-gray-900:not(#home .text-gray-900) {
        color: #000000 !important;
        font-weight: 600 !important;
    }
    
    /* 카드 배경 흰색으로 */
    .bg-white {
        background-color: #ffffff !important;
        border: 1px solid #e5e7eb !important;
    }
    
    /* 컬러 배지는 원래 색상 유지 */
    .bg-blue-100, .bg-green-100, .bg-red-100, 
    .bg-purple-100, .bg-indigo-100, .bg-teal-100,
    .bg-orange-100, .bg-emerald-100, .bg-amber-100,
    .bg-yellow-50, .bg-amber-50, .bg-orange-50 {
        background-color: inherit !important;
    }
    
    /* 그라디언트 버튼의 텍스트는 원래 색상 유지 */
    .bg-gradient-to-r, .bg-gradient-to-br,
    button.bg-gradient-to-r *,
    a.bg-gradient-to-r * {
        color: inherit !important;
    }
    
    /* Footer 최적화 - 어두운 배경에 밝은 텍스트 */
    footer.bg-gray-900 {
        background-color: #1f2937 !important;
    }
    
    footer .text-gray-400 {
        color: #e5e7eb !important;
        font-weight: 400 !important;
    }
    
    footer h4 {
        color: #ffffff !important;
        font-weight: 700 !important;
    }
    
    footer a.text-gray-400 {
        color: #d1d5db !important;
    }
    
    footer a.text-gray-400:hover {
        color: #ffffff !important;
    }
    
    /* 빈 컨테이너 제거 */
    .module-container:empty {
        display: none !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* 파란색 계열 텍스트 강화 */
    .text-blue-600,
    .text-blue-700,
    .text-blue-500 {
        color: #1e40af !important;
        font-weight: 600 !important;
    }
    
    /* 리스트 아이템 */
    li {
        color: #1f2937 !important;
        font-weight: 500 !important;
    }
    
    /* 카드 내부 텍스트 */
    .card p,
    .service-card p,
    .bg-white p {
        color: #1f2937 !important;
        font-weight: 500 !important;
    }
}

/* Extra Small Devices (phones, 575px and down) */
@media (max-width: 575px) {
    /* Hero Section */
    #home .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    #home h1 {
        font-size: 2rem;
        line-height: 1.2;
        color: #000000 !important;
        font-weight: 700 !important;
    }
    
    #home p {
        font-size: 1rem;
        color: #1f2937 !important;
        font-weight: 500 !important;
    }
    
    /* Navigation */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Service Cards */
    #services .grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* About Section */
    #about .grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Solutions Section */
    #solutions .grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Contact Form */
    #contact .grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Footer */
    footer .grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767px) {
    /* Hero Section */
    #home h1 {
        font-size: 2.5rem;
    }
    
    #home p {
        font-size: 1.125rem;
    }
    
    /* Service Cards */
    #services .grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* About Section */
    #about .grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    /* Footer */
    footer .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991px) {
    /* Hero Section */
    #home h1 {
        font-size: 3rem;
    }
    
    /* Service Cards - 2 columns on tablet */
    #services .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    #services .grid > div:last-child {
        grid-column: 1 / -1;
        max-width: 50%;
        margin: 0 auto;
    }
    
    /* About Section */
    #about .grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    /* Footer */
    footer .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199px) {
    /* Container max width */
    .container {
        max-width: 960px;
    }
    
    /* Hero Section */
    #home h1 {
        font-size: 3.5rem;
    }
    
    /* Service Cards */
    #services .grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Footer */
    footer .grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    /* Hero Section */
    #home h1 {
        font-size: 4rem;
    }
    
    #home p {
        font-size: 1.25rem;
    }
}

/* Ultra Wide Devices (1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    /* Hero Section */
    #home h1 {
        font-size: 4.5rem;
    }
}

/* Portrait Orientation */
@media (orientation: portrait) {
    /* Adjust hero section for portrait mode */
    #home {
        padding-top: 5rem;
        padding-bottom: 3rem;
    }
    
    /* Stack buttons vertically in portrait */
    #home .flex.flex-col.md\\:flex-row {
        flex-direction: column;
    }
    
    #home .flex.flex-col.md\\:flex-row > a {
        margin-bottom: 0.5rem;
    }
}

/* Landscape Orientation */
@media (orientation: landscape) and (max-height: 600px) {
    /* Reduce padding for landscape mobile devices */
    #home {
        padding-top: 3rem;
        padding-bottom: 2rem;
    }
    
    #home h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    #home p {
        margin-bottom: 1.5rem;
    }
    
    section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimize for retina displays */
    .particle {
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.15);
    }
    
    /* Sharper shadows for high DPI */
    .shadow-lg {
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    }
}

/* Dark Mode Preferences */
@media (prefers-color-scheme: dark) {
    /* Adjust for users who prefer dark mode */
    .bg-gray-50 {
        background-color: #1f2937 !important;
    }
    
    .text-gray-700 {
        color: #e5e7eb !important;
    }
    
    .text-gray-900 {
        color: #f9fafb !important;
    }
    
    .bg-white {
        background-color: #374151 !important;
        border: 1px solid #4b5563 !important;
    }
}

/* Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
    /* Disable animations for users who prefer reduced motion */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .particle {
        animation: none !important;
    }
    
    .fade-in-up,
    .slide-in-left,
    .slide-in-right {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Print Styles */
@media print {
    /* Hide navigation and interactive elements */
    header,
    #mobile-menu,
    button,
    .no-print {
        display: none !important;
    }
    
    /* Adjust colors for print */
    * {
        color: #000 !important;
        background: #fff !important;
    }
    
    /* Ensure proper page breaks */
    section {
        page-break-inside: avoid;
        margin-bottom: 2rem;
    }
    
    /* Show URLs for links */
    a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
    
    /* Optimize text for print */
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
}

/* Container Query Support (Modern Browsers) */
@supports (container-type: inline-size) {
    .service-card {
        container-type: inline-size;
    }
    
    @container (min-width: 300px) {
        .service-card h3 {
            font-size: 1.5rem;
        }
    }
    
    @container (min-width: 400px) {
        .service-card {
            padding: 2rem;
        }
    }
}

/* Focus Management for Keyboard Navigation */
@media (hover: none) and (pointer: coarse) {
    /* Touch device optimizations */
    button,
    a {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Larger touch targets */
    .mobile-menu a {
        padding: 0.75rem 0;
        display: block;
    }
}

/* Hover Support Detection */
@media (hover: hover) {
    /* Only apply hover effects on devices that support hover */
    .service-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    }
    
    .btn-primary:hover {
        transform: translateY(-1px);
    }
}

/* Motion Support Detection */
@media (prefers-reduced-motion: no-preference) {
    /* Enhanced animations for users who don't mind motion */
    .service-card {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .fade-in-up {
        animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }
}