/* ===== Mobile Responsive All Pages ===== */
/* 2025년 12월 18일 - 전체 페이지 모바일 반응형 디자인 */

/* ===== 0. 데스크톱 복원 스타일 (993px 이상) ===== */
/* 창 크기 변경 시 모바일 스타일이 유지되는 문제 해결 */
@media (min-width: 993px) {
    .paradigm-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 32px !important;
        max-width: none !important;
    }

    .paradigm-card-v2 {
        padding: 48px 32px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 0 !important;
    }

    .paradigm-card-v2 .card-icon,
    .paradigm-card-v2 .card-icon-svg {
        width: 88px !important;
        height: 88px !important;
        min-width: auto !important;
        font-size: 2.25rem !important;
        margin: 0 auto 24px !important;
        border-radius: 24px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .paradigm-card-v2 .card-content {
        flex: none !important;
        text-align: center !important;
    }

    .paradigm-card-v2 .card-title {
        font-size: 1.25rem !important;
        margin-bottom: 12px !important;
        text-align: center !important;
    }

    .paradigm-card-v2 .card-desc {
        font-size: 0.95rem !important;
        margin-bottom: 0 !important;
        text-align: center !important;
    }

    .solutions-showcase-compact {
        grid-template-columns: 1fr 1fr !important;
        gap: 40px !important;
    }

    .solutions-cards-area {
        gap: 16px !important;
    }

    .solution-card-compact {
        padding: 24px !important;
        flex-direction: column !important;
        text-align: center !important;
        align-items: stretch !important;
    }

    .card-header-compact {
        flex-direction: column !important;
        gap: 8px !important;
        margin-bottom: 16px !important;
        align-items: center !important;
        min-width: auto !important;
    }

    .card-icon-compact {
        font-size: 2.5rem !important;
    }

    .card-body-compact {
        text-align: center !important;
    }

    .card-body-compact h3 {
        font-size: 1.1rem !important;
        margin-bottom: 8px !important;
    }

    .card-body-compact p {
        font-size: 0.9rem !important;
        margin-bottom: 16px !important;
    }

    .feature-cards-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 20px !important;
    }

    .feature-detail-card {
        padding: 24px !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 0 !important;
    }

    .detail-icon {
        width: 56px !important;
        height: 56px !important;
        min-width: auto !important;
        font-size: 1.5rem !important;
        margin-bottom: 16px !important;
    }

    .feature-detail-card .detail-features {
        display: block !important;
    }
}

/* ===== 1. 기본 모바일 스타일 (768px 이하) ===== */
@media (max-width: 768px) {

    /* === 1.1 히어로 섹션 === */
    .hero-section {
        min-height: 70vh;
        height: auto;
    }

    .hero-title {
        font-size: 1.75rem !important;
        line-height: 1.3;
        margin-bottom: 0.75rem;
        padding: 0 10px;
    }

    .hero-subtitle {
        font-size: 1rem !important;
        margin-bottom: 0.75rem;
        padding: 0 10px;
    }

    .hero-description {
        font-size: 0.9rem !important;
        line-height: 1.6;
        margin-bottom: 1.5rem;
        padding: 0 15px;
    }

    .hero-text-wrapper {
        width: 95% !important;
    }

    .hero-bg-logo {
        width: 200px !important;
        height: 200px !important;
        opacity: 0.1 !important;
    }

    /* === 1.2 섹션 헤더 === */
    .section-header {
        margin-bottom: 30px;
        padding: 0 15px;
    }

    .section-label {
        font-size: 0.7rem;
        padding: 6px 16px;
        margin-bottom: 16px;
    }

    .section-title-v2,
    .section-title {
        font-size: 1.5rem !important;
        line-height: 1.3;
        margin-bottom: 12px;
    }

    .section-desc {
        font-size: 0.9rem !important;
        line-height: 1.6;
        padding: 0 10px;
    }

    /* === 1.3 패러다임 카드 (메인 페이지) === */
    .paradigm-section-v2 {
        padding: 40px 0 30px;
    }

    .paradigm-container {
        padding: 0 15px;
    }

    .paradigm-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .paradigm-card-v2 {
        padding: 16px 18px !important;
        border-radius: 14px;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        text-align: left !important;
        gap: 15px;
    }

    .paradigm-card-v2 .card-icon {
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        font-size: 1.25rem !important;
        margin: 0 !important;
        border-radius: 12px !important;
    }

    .paradigm-card-v2 .card-title {
        font-size: 1rem !important;
        margin-bottom: 4px !important;
    }

    .paradigm-card-v2 .card-desc {
        font-size: 0.8rem !important;
        line-height: 1.4;
        margin-bottom: 0 !important;
    }

    /* 선택된 카드 체크마크 위치 조정 */
    .paradigm-card-v2.active::before,
    .paradigm-card-v2.active::after {
        top: -8px !important;
        right: -8px !important;
        width: 24px !important;
        height: 24px !important;
    }

    .paradigm-card-v2.active::after {
        font-size: 14px !important;
    }

    /* === 1.3.1 패러다임 상세 섹션 === */
    .paradigm-detail-section {
        margin-top: 20px !important;
        padding: 15px 10px !important;
        border-radius: 14px;
    }

    .paradigm-detail-section::before {
        font-size: 0.65rem !important;
        padding: 3px 10px !important;
        top: -10px !important;
        left: 12px !important;
    }

    .feature-cards-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .feature-detail-card {
        padding: 14px 12px !important;
        border-radius: 10px;
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;
        gap: 12px;
    }

    .detail-icon {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        font-size: 1rem !important;
        margin-bottom: 0 !important;
        border-radius: 10px !important;
    }

    .detail-badge {
        font-size: 0.6rem !important;
        padding: 2px 8px !important;
        margin-bottom: 6px !important;
        display: inline-block;
    }

    .detail-title {
        font-size: 0.95rem !important;
        margin-bottom: 4px !important;
    }

    .detail-desc {
        font-size: 0.8rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0 !important;
    }

    .feature-detail-card .detail-features {
        display: none !important;
    }

    /* === 1.4 솔루션 카드 (메인 페이지) === */
    .solutions-section-compact {
        padding: 35px 0 30px;
    }

    .solutions-container-compact {
        padding: 0 15px !important;
    }

    .solutions-showcase-compact {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        margin-top: 25px !important;
    }

    .solutions-cards-area {
        gap: 10px !important;
    }

    .solution-card-compact {
        padding: 14px 15px !important;
        border-radius: 12px;
        flex-direction: row !important;
        text-align: left !important;
        align-items: center !important;
        gap: 12px;
    }

    .solution-card-compact::before {
        width: 4px !important;
        height: 100% !important;
        left: 0 !important;
        top: 0 !important;
    }

    .card-header-compact {
        flex-direction: column !important;
        gap: 6px !important;
        margin-bottom: 0 !important;
        justify-content: center;
        align-items: center;
        min-width: 60px;
    }

    .card-icon-compact {
        font-size: 1.75rem !important;
    }

    .card-badge {
        font-size: 0.55rem !important;
        padding: 2px 6px !important;
    }

    .card-body-compact {
        text-align: left !important;
        flex: 1;
    }

    .card-body-compact h3 {
        font-size: 0.95rem !important;
        margin-bottom: 4px !important;
    }

    .card-body-compact p {
        font-size: 0.78rem !important;
        margin-bottom: 8px !important;
        line-height: 1.4;
    }

    .solution-btn-compact {
        padding: 8px 14px !important;
        font-size: 0.75rem !important;
        width: auto !important;
        justify-content: center;
    }

    .solutions-grid-compact {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    .card-title-compact {
        font-size: 0.95rem !important;
        margin-bottom: 6px;
    }

    .card-desc-compact {
        font-size: 0.78rem !important;
        line-height: 1.4;
        margin-bottom: 8px;
    }

    .card-features-compact {
        margin-bottom: 10px;
    }

    .card-features-compact li {
        font-size: 0.75rem !important;
        padding: 3px 0;
    }

    /* === 1.5 회사소개 페이지 === */
    .company-about-container {
        padding: 0 15px;
    }

    /* 회사 정보 섹션 */
    .company-info-section {
        padding: 40px 0 30px;
    }

    .info-cards-container {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    .info-card {
        padding: 20px 15px;
    }

    .info-card .info-icon,
    .info-icon-svg {
        width: 45px !important;
        height: 45px !important;
        font-size: 1.2rem !important;
    }

    .info-card .info-label {
        font-size: 0.75rem !important;
    }

    .info-card .info-value {
        font-size: 0.9rem !important;
    }

    /* 비전/미션 카드 */
    .vision-mission-container {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    .vm-card {
        padding: 20px 15px;
    }

    .vm-icon,
    .vm-icon-svg {
        width: 45px !important;
        height: 45px !important;
        font-size: 1.2rem !important;
    }

    .vm-card h3 {
        font-size: 1rem !important;
        margin-bottom: 8px;
    }

    .vm-card p {
        font-size: 0.85rem !important;
        line-height: 1.5;
    }

    /* 핵심 가치 섹션 */
    .core-values-section {
        padding: 40px 0 30px;
    }

    .values-container {
        grid-template-columns: 1fr !important;
        gap: 15px;
        padding: 0 10px;
    }

    .value-card {
        padding: 25px 20px;
    }

    .value-icon {
        width: 55px !important;
        height: 55px !important;
        font-size: 1.4rem !important;
        margin-bottom: 15px;
    }

    .value-card h3 {
        font-size: 1.1rem !important;
        margin-bottom: 8px;
    }

    .value-card p {
        font-size: 0.8rem !important;
        line-height: 1.5;
    }

    /* 주요 거래처 섹션 */
    .clients-section {
        padding: 40px 0 50px;
    }

    .clients-by-region {
        gap: 25px;
    }

    .region-card {
        padding: 15px;
    }

    .region-card h3 {
        font-size: 1rem !important;
        margin-bottom: 12px;
    }

    .client-tags {
        gap: 6px;
    }

    .client-tag {
        font-size: 0.75rem !important;
        padding: 5px 10px;
    }

    /* === 1.6 솔루션 페이지 공통 === */
    .solution-hero {
        min-height: 50vh;
        padding: 80px 15px 40px;
    }

    .solution-hero h1 {
        font-size: 1.5rem !important;
        margin-bottom: 10px;
    }

    .solution-hero p {
        font-size: 0.9rem !important;
    }

    /* 탭 네비게이션 */
    .tabs-nav,
    .tab-navigation {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 0 10px;
    }

    .tabs-nav::-webkit-scrollbar,
    .tab-navigation::-webkit-scrollbar {
        display: none;
    }

    .tab-button {
        min-width: 80px !important;
        padding: 10px 12px !important;
        font-size: 0.75rem !important;
    }

    .tab-button .tab-icon {
        font-size: 1.1rem !important;
        margin-bottom: 4px;
    }

    .tab-button .tab-label {
        font-size: 0.7rem !important;
    }

    /* 탭 콘텐츠 */
    .tab-content,
    .tab-pane {
        padding: 20px 15px;
    }

    /* 관리 카드 */
    .management-card,
    .module-card {
        padding: 20px 15px;
        margin-bottom: 15px;
    }

    .management-card h3,
    .module-card h3,
    .management-title,
    .module-title {
        font-size: 1rem !important;
        margin-bottom: 10px;
    }

    .management-features,
    .feature-list {
        gap: 8px;
    }

    .management-features li,
    .feature-list li {
        font-size: 0.85rem !important;
        padding: 6px 0;
    }

    .management-icon,
    .module-icon {
        width: 45px !important;
        height: 45px !important;
        font-size: 1.2rem !important;
    }

    /* 공통 관리 섹션 */
    .common-management {
        padding: 30px 15px;
    }

    .common-management h2 {
        font-size: 1.2rem !important;
        margin-bottom: 20px;
    }

    .common-management-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    /* 대시보드 섹션 */
    .dashboard-section {
        padding: 30px 15px;
    }

    .dashboard-section h2 {
        font-size: 1.2rem !important;
    }

    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    /* 솔루션 이미지 - 모바일에서 그리드로 표시 */
    .rotating-images-container {
        display: flex !important;
        height: auto !important;
        padding: 15px 0;
    }

    .rotating-wrapper {
        width: 100%;
        max-width: 100%;
        height: auto !important;
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 0 10px;
    }

    .rotating-image-item {
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        animation: none !important;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .rotating-image-item:nth-child(1),
    .rotating-image-item:nth-child(2),
    .rotating-image-item:nth-child(3) {
        top: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
    }

    .rotating-image-item:active {
        transform: scale(0.98) !important;
    }

    .image-overlay {
        padding: 8px 4px 6px;
        font-size: 0.7rem;
    }

    /* === 1.7 푸터 === */
    .main-footer {
        padding: 40px 15px 20px;
    }

    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 25px;
        text-align: center;
    }

    .footer-company-name {
        font-size: 1.1rem !important;
    }

    .footer-info-item {
        font-size: 0.8rem !important;
        justify-content: center;
    }

    .footer-section-title {
        font-size: 0.9rem !important;
        margin-bottom: 12px;
    }

    .footer-links li {
        font-size: 0.8rem !important;
    }

    .footer-bottom {
        padding-top: 20px;
        margin-top: 20px;
    }

    .footer-bottom p {
        font-size: 0.7rem !important;
    }

    /* === 1.8 Back to Top 버튼 === */
    .back-to-top-btn {
        width: 45px !important;
        height: 45px !important;
        font-size: 1rem !important;
        right: 15px !important;
        bottom: 15px !important;
    }

    /* === 1.9 버튼 공통 === */
    .btn,
    button[class*="btn"] {
        padding: 10px 20px;
        font-size: 0.85rem !important;
        min-height: 44px; /* 터치 친화적 크기 */
    }

    .btn-primary {
        padding: 12px 24px;
    }
}

/* ===== 2. 작은 모바일 (480px 이하) ===== */
@media (max-width: 480px) {

    /* 히어로 섹션 */
    .hero-title {
        font-size: 1.5rem !important;
    }

    .hero-subtitle {
        font-size: 0.9rem !important;
    }

    .hero-description {
        font-size: 0.8rem !important;
    }

    /* 섹션 제목 */
    .section-title-v2,
    .section-title {
        font-size: 1.25rem !important;
    }

    .section-desc {
        font-size: 0.8rem !important;
    }

    /* 카드들 */
    .paradigm-card-v2,
    .solution-card-compact,
    .value-card {
        padding: 20px 15px;
    }

    .paradigm-icon,
    .card-icon-compact {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.3rem !important;
    }

    .value-icon {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.2rem !important;
    }

    /* 탭 버튼 */
    .tab-button {
        min-width: 70px !important;
        padding: 8px 10px !important;
    }

    .tab-button .tab-icon {
        font-size: 1rem !important;
    }

    .tab-button .tab-label {
        font-size: 0.65rem !important;
    }

    /* 관리 카드 */
    .management-card h3,
    .module-card h3 {
        font-size: 0.95rem !important;
    }

    .management-features li,
    .feature-list li {
        font-size: 0.8rem !important;
    }

    /* 거래처 태그 */
    .client-tag {
        font-size: 0.7rem !important;
        padding: 4px 8px;
    }
}

/* ===== 3. 태블릿 세로 (481px ~ 768px) ===== */
@media (min-width: 481px) and (max-width: 768px) {

    /* 2열 그리드 레이아웃 */
    .paradigm-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .solutions-grid-compact {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .values-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .info-cards-container {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .vision-mission-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .common-management-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ===== 4. 태블릿 가로 (769px ~ 1024px) ===== */
@media (min-width: 769px) and (max-width: 1024px) {

    /* 히어로 섹션 */
    .hero-title {
        font-size: 2.5rem !important;
    }

    .hero-subtitle {
        font-size: 1.25rem !important;
    }

    /* 섹션 */
    .paradigm-section-v2,
    .solutions-section-compact {
        padding: 70px 0;
    }

    .section-title-v2 {
        font-size: 2rem !important;
    }

    /* 그리드 */
    .paradigm-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }

    .solutions-grid-compact {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .paradigm-card-v2,
    .solution-card-compact {
        padding: 35px 25px;
    }

    /* 탭 */
    .tab-button {
        min-width: 100px;
        padding: 12px 15px;
    }
}

/* ===== 5. 가로 모드 최적화 ===== */
@media (max-height: 500px) and (orientation: landscape) {

    .hero-section {
        min-height: 100vh;
    }

    .hero-title {
        font-size: 1.5rem !important;
    }

    .hero-subtitle {
        font-size: 0.9rem !important;
    }

    .hero-description {
        display: none;
    }

    .section-header {
        margin-bottom: 20px;
    }

    .paradigm-section-v2,
    .solutions-section-compact {
        padding: 40px 0;
    }
}

/* ===== 6. 터치 디바이스 최적화 ===== */
@media (hover: none) and (pointer: coarse) {

    /* 터치 타겟 최소 크기 보장 */
    .tab-button,
    .btn,
    button,
    a.nav-link,
    .client-tag,
    .solution-btn-compact {
        min-height: 44px;
        min-width: 44px;
    }

    /* 호버 효과 제거 (터치에서 불필요) */
    .paradigm-card-v2:hover,
    .solution-card-compact:hover,
    .value-card:hover,
    .management-card:hover {
        transform: none;
    }

    /* 탭 시 피드백 */
    .paradigm-card-v2:active,
    .solution-card-compact:active,
    .value-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* ===== 7. 애니메이션 성능 최적화 ===== */
@media (max-width: 768px) {

    /* 모바일에서 복잡한 애니메이션 단순화 */
    .paradigm-card-v2,
    .solution-card-compact,
    .value-card,
    .management-card {
        transition: transform 0.2s ease !important;
    }

    /* GPU 가속 활성화 */
    .tab-button,
    .back-to-top-btn {
        transform: translateZ(0);
        backface-visibility: hidden;
    }
}

/* ===== 8. 접근성 개선 ===== */
@media (max-width: 768px) {

    /* 포커스 표시 강화 */
    .tab-button:focus-visible,
    .btn:focus-visible,
    a:focus-visible {
        outline: 3px solid var(--primary-color);
        outline-offset: 2px;
    }

    /* 읽기 쉬운 줄 간격 */
    p, li, .card-desc-compact, .paradigm-card-v2 p {
        line-height: 1.6;
    }
}

/* ===== 9. iOS Safari 특수 처리 ===== */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 768px) {

        /* Safe area 대응 */
        .main-header {
            padding-top: env(safe-area-inset-top);
        }

        .main-footer {
            padding-bottom: env(safe-area-inset-bottom);
        }

        .back-to-top-btn {
            bottom: calc(15px + env(safe-area-inset-bottom)) !important;
        }

        /* 스크롤 바운스 */
        body {
            -webkit-overflow-scrolling: touch;
        }
    }
}

/* ===== 10. 다크 모드 대응 (시스템 설정) ===== */
@media (prefers-color-scheme: dark) {
    @media (max-width: 768px) {

        /* 다크 모드에서도 밝은 배경 유지 */
        .main-header,
        .mobile-menu,
        .paradigm-card-v2,
        .solution-card-compact,
        .value-card,
        .management-card {
            background-color: #ffffff !important;
            color: #111827 !important;
        }
    }
}

/* ===== 11. 감소된 모션 선호 사용자 ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
