/* ============================================
   NEXO KOREA 테마 시스템
   - 기본: 라이트 테마
   - data-theme="dark" 시 다크 테마 (원본)
   - 네비게이션/푸터는 항상 다크 유지
   ============================================ */

/* ===== 라이트 테마 (기본) ===== */
html:not([data-theme="dark"]) body {
    background: #f8fafc !important;
    color: #1e293b !important;
}

/* --- 배경색 --- */
html:not([data-theme="dark"]) .bg-nexo-navy,
html:not([data-theme="dark"]) .bg-nexo-dark {
    background: #f8fafc !important;
}

html:not([data-theme="dark"]) .bg-slate-900 {
    background: #ffffff !important;
}

html:not([data-theme="dark"]) .bg-slate-800 {
    background: #f1f5f9 !important;
}

html:not([data-theme="dark"]) .bg-slate-800\/50 {
    background: rgba(241, 245, 249, 0.8) !important;
}

html:not([data-theme="dark"]) .bg-slate-700\/50 {
    background: rgba(226, 232, 240, 0.5) !important;
}

html:not([data-theme="dark"]) .bg-slate-900\/80 {
    background: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* --- 텍스트 색상 --- */
html:not([data-theme="dark"]) .text-white {
    color: #1e293b !important;
}

html:not([data-theme="dark"]) .text-slate-300,
html:not([data-theme="dark"]) .text-slate-400 {
    color: #64748b !important;
}

html:not([data-theme="dark"]) .text-slate-500 {
    color: #94a3b8 !important;
}

/* --- 포인트 컬러: 시안 → 딥 블루 --- */
html:not([data-theme="dark"]) .text-nexo-cyan {
    color: #2563eb !important;
}

html:not([data-theme="dark"]) .bg-nexo-cyan {
    background: #2563eb !important;
}

html:not([data-theme="dark"]) .bg-nexo-cyan\/20 {
    background: rgba(37, 99, 235, 0.1) !important;
}

html:not([data-theme="dark"]) .bg-nexo-cyan\/30 {
    background: rgba(37, 99, 235, 0.15) !important;
}

html:not([data-theme="dark"]) .text-nexo-navy {
    color: #ffffff !important;
}

/* --- 보더 --- */
html:not([data-theme="dark"]) .border-slate-700,
html:not([data-theme="dark"]) .border-slate-800,
html:not([data-theme="dark"]) .border-slate-600 {
    border-color: #e2e8f0 !important;
}

html:not([data-theme="dark"]) .border-nexo-cyan\/50 {
    border-color: rgba(37, 99, 235, 0.3) !important;
}

html:not([data-theme="dark"]) .hover\:border-nexo-cyan:hover {
    border-color: #2563eb !important;
}

html:not([data-theme="dark"]) .hover\:border-nexo-cyan\/50:hover {
    border-color: rgba(37, 99, 235, 0.4) !important;
}

/* --- 카드 스타일 --- */
html:not([data-theme="dark"]) .bg-slate-800.rounded-2xl,
html:not([data-theme="dark"]) .bg-slate-800.rounded-xl {
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

/* --- 버튼 --- */
html:not([data-theme="dark"]) .bg-nexo-cyan.text-nexo-navy {
    background: #2563eb !important;
    color: #ffffff !important;
}

html:not([data-theme="dark"]) .bg-nexo-cyan.text-nexo-navy:hover {
    background: #1d4ed8 !important;
    color: #ffffff !important;
}

html:not([data-theme="dark"]) .hover\:bg-white:hover {
    background: #1e293b !important;
    color: #ffffff !important;
}

html:not([data-theme="dark"]) .hover\:text-white:hover {
    color: #2563eb !important;
}

/* CTA 섹션 버튼 (견적문의 등) */
html:not([data-theme="dark"]) section .bg-nexo-cyan {
    background: #2563eb !important;
    color: #ffffff !important;
}

html:not([data-theme="dark"]) section .bg-nexo-orange {
    background: #f97316 !important;
}

html:not([data-theme="dark"]) .hover\:bg-slate-700:hover {
    background: #e2e8f0 !important;
}

html:not([data-theme="dark"]) .hover\:bg-slate-800:hover {
    background: #f1f5f9 !important;
}

/* --- Shadow --- */
html:not([data-theme="dark"]) .shadow-\[0_0_30px_rgba\(6\,182\,212\,0\.3\)\] {
    box-shadow: 0 0 30px rgba(37, 99, 235, 0.2) !important;
}

html:not([data-theme="dark"]) .shadow-\[0_0_15px_rgba\(6\,182\,212\,0\.4\)\] {
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.25) !important;
}

/* --- 그라데이션 --- */
html:not([data-theme="dark"]) .bg-gradient-to-t.from-nexo-navy {
    background: linear-gradient(to top, rgba(248,250,252,1), rgba(248,250,252,0.8), transparent) !important;
}

/* --- 글로우 텍스트 --- */
html:not([data-theme="dark"]) .glow-text {
    text-shadow: none !important;
    color: #2563eb !important;
}

/* --- input 필드 --- */
html:not([data-theme="dark"]) input.bg-slate-800,
html:not([data-theme="dark"]) input[class*="bg-slate-800"],
html:not([data-theme="dark"]) textarea.bg-slate-800,
html:not([data-theme="dark"]) textarea[class*="bg-slate-800"] {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #1e293b !important;
}

html:not([data-theme="dark"]) input::placeholder,
html:not([data-theme="dark"]) textarea::placeholder {
    color: #94a3b8 !important;
}

/* --- FAQ --- */
html:not([data-theme="dark"]) .bg-slate-900.overflow-hidden {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

html:not([data-theme="dark"]) .bg-slate-900\/50 {
    background: rgba(248, 250, 252, 0.8) !important;
}

html:not([data-theme="dark"]) .faq-btn:hover {
    background: #f1f5f9 !important;
}

/* --- 블로그 페이지 --- */
html:not([data-theme="dark"]) .bg-green-500\/20 {
    background: rgba(34, 197, 94, 0.1) !important;
}

html:not([data-theme="dark"]) .bg-green-500\/30 {
    background: rgba(34, 197, 94, 0.15) !important;
}

html:not([data-theme="dark"]) .hover\:border-green-400\/50:hover {
    border-color: rgba(34, 197, 94, 0.4) !important;
}

/* --- 섹션 배경 교차 (라이트에서 구분감) --- */
html:not([data-theme="dark"]) section.bg-nexo-dark,
html:not([data-theme="dark"]) section.bg-nexo-navy {
    background: #f1f5f9 !important;
}

html:not([data-theme="dark"]) section.bg-slate-900 {
    background: #ffffff !important;
}

/* 아이콘 카드 구분 */
html:not([data-theme="dark"]) .bg-slate-800\/50.backdrop-blur {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* group-hover 텍스트 */
html:not([data-theme="dark"]) .group-hover\:text-nexo-cyan {
    color: #2563eb !important;
}

/* 네비 카드의 hover시 text-nexo-cyan */
html:not([data-theme="dark"]) .group:hover .group-hover\:text-nexo-cyan {
    color: #2563eb !important;
}

/* --- 스크롤바 --- */
html:not([data-theme="dark"]) ::-webkit-scrollbar-track {
    background: #f1f5f9 !important;
}

html:not([data-theme="dark"]) ::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
}

html:not([data-theme="dark"]) ::-webkit-scrollbar-thumb:hover {
    background: #2563eb !important;
}

/* --- 모달 --- */
html:not([data-theme="dark"]) .bg-slate-900.rounded-2xl {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}


/* =============================================
   네비게이션 & 푸터: 항상 다크 유지
   ============================================= */

/* 네비게이션 - 항상 다크 */
html:not([data-theme="dark"]) .glass-nav,
html:not([data-theme="dark"]) #navbar {
    background: rgba(15, 23, 42, 0.95) !important;
    border-bottom-color: #334155 !important;
}

html:not([data-theme="dark"]) #navbar .text-white,
html:not([data-theme="dark"]) nav .text-white {
    color: #ffffff !important;
}

html:not([data-theme="dark"]) #navbar .text-slate-300,
html:not([data-theme="dark"]) nav .text-slate-300 {
    color: #cbd5e1 !important;
}

html:not([data-theme="dark"]) nav a.hover\:text-white:hover {
    color: #ffffff !important;
}

html:not([data-theme="dark"]) nav .bg-nexo-cyan,
html:not([data-theme="dark"]) #navbar .bg-nexo-cyan {
    background: #06b6d4 !important;
    color: #0f172a !important;
}

html:not([data-theme="dark"]) nav .text-nexo-navy {
    color: #0f172a !important;
}

/* 모바일 메뉴 - 항상 다크 */
html:not([data-theme="dark"]) #mobile-menu .bg-nexo-navy {
    background: #0f172a !important;
}

html:not([data-theme="dark"]) #mobile-menu .text-white {
    color: #ffffff !important;
}

html:not([data-theme="dark"]) #mobile-menu a.text-white {
    color: #ffffff !important;
}

html:not([data-theme="dark"]) #mobile-menu a:hover {
    background: #1e293b !important;
}

html:not([data-theme="dark"]) #mobile-menu .bg-nexo-cyan {
    background: #06b6d4 !important;
    color: #0f172a !important;
}

html:not([data-theme="dark"]) #mobile-menu .text-nexo-navy {
    color: #0f172a !important;
}

html:not([data-theme="dark"]) #mobile-menu .text-slate-400 {
    color: #94a3b8 !important;
}

html:not([data-theme="dark"]) #mobile-menu .border-slate-800 {
    border-color: #1e293b !important;
}

/* 푸터 - 항상 다크 (높은 우선순위) */
html:not([data-theme="dark"]) body footer#contact,
html:not([data-theme="dark"]) body footer,
html:not([data-theme="dark"]) #footer-placeholder footer,
html:not([data-theme="dark"]) #footer-placeholder {
    background: #0f172a !important;
    color: #ffffff !important;
}

html:not([data-theme="dark"]) body footer *,
html:not([data-theme="dark"]) #footer-placeholder footer * {
    /* 기본 리셋: 푸터 안 모든 요소 */
}

html:not([data-theme="dark"]) footer h2,
html:not([data-theme="dark"]) footer h4,
html:not([data-theme="dark"]) footer span.text-white,
html:not([data-theme="dark"]) footer .text-white,
html:not([data-theme="dark"]) footer .font-black {
    color: #ffffff !important;
}

html:not([data-theme="dark"]) footer .text-slate-300 {
    color: #cbd5e1 !important;
}

html:not([data-theme="dark"]) footer .text-slate-400,
html:not([data-theme="dark"]) footer .text-slate-500,
html:not([data-theme="dark"]) footer p {
    color: #94a3b8 !important;
}

html:not([data-theme="dark"]) footer .border-slate-800,
html:not([data-theme="dark"]) footer .border-slate-700 {
    border-color: #1e293b !important;
}

html:not([data-theme="dark"]) footer .text-nexo-cyan,
html:not([data-theme="dark"]) footer i.text-nexo-cyan {
    color: #06b6d4 !important;
}

html:not([data-theme="dark"]) footer .bg-nexo-navy,
html:not([data-theme="dark"]) footer.bg-nexo-navy {
    background: #0f172a !important;
}

html:not([data-theme="dark"]) footer .bg-slate-900,
html:not([data-theme="dark"]) footer div.bg-slate-900 {
    background: #1e293b !important;
}

html:not([data-theme="dark"]) footer a.bg-white,
html:not([data-theme="dark"]) footer .bg-white {
    background: #ffffff !important;
    color: #0f172a !important;
}

html:not([data-theme="dark"]) footer .text-nexo-navy,
html:not([data-theme="dark"]) footer a .text-nexo-navy {
    color: #0f172a !important;
}

html:not([data-theme="dark"]) footer a.hover\:text-white:hover {
    color: #ffffff !important;
}

html:not([data-theme="dark"]) footer a.hover\:bg-nexo-cyan:hover {
    background: #06b6d4 !important;
}


/* =============================================
   히어로 섹션 (index.html) 라이트 대응
   ============================================= */
html:not([data-theme="dark"]) section.relative.min-h-screen .text-white,
html:not([data-theme="dark"]) section.relative.min-h-screen h1 .text-white,
html:not([data-theme="dark"]) section.relative.min-h-screen h1 {
    color: #1e293b !important;
}

html:not([data-theme="dark"]) section.relative.min-h-screen .text-slate-400 {
    color: #64748b !important;
}

html:not([data-theme="dark"]) section.relative.min-h-screen .bg-slate-900\/80 {
    background: rgba(255,255,255,0.85) !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

html:not([data-theme="dark"]) section.relative.min-h-screen .bg-slate-800\/50 {
    background: rgba(255,255,255,0.7) !important;
    border-color: #e2e8f0 !important;
}

/* 히어로 배경 그라데이션 - 밝게 */
html:not([data-theme="dark"]) section.relative.min-h-screen .absolute.inset-0.bg-gradient-to-t {
    background: linear-gradient(to top, rgba(248,250,252,1) 0%, rgba(248,250,252,0.85) 40%, rgba(248,250,252,0.4) 100%) !important;
}

/* 히어로 이미지 밝게 */
html:not([data-theme="dark"]) section.relative.min-h-screen img.opacity-30 {
    opacity: 0.15 !important;
}


/* =============================================
   고객사/파트너 섹션 (Customers)
   ============================================= */
html:not([data-theme="dark"]) #customers {
    background: #ffffff !important;
}

html:not([data-theme="dark"]) #customers .bg-white {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06) !important;
    border-width: 1px !important;
    transition: all 0.3s ease;
}

html:not([data-theme="dark"]) #customers .bg-white:hover {
    box-shadow: 0 8px 24px rgba(37,99,235,0.12), 0 2px 6px rgba(0,0,0,0.06) !important;
    border-color: #93c5fd !important;
    transform: translateY(-4px);
}


/* =============================================
   제품소개 페이지 (product.html)
   ============================================= */

/* 테이블 */
html:not([data-theme="dark"]) table.bg-slate-800 {
    background: #ffffff !important;
}

html:not([data-theme="dark"]) table tr.bg-nexo-navy {
    background: #1e293b !important;
}

html:not([data-theme="dark"]) table tr.bg-nexo-navy th,
html:not([data-theme="dark"]) table tr.bg-nexo-navy td {
    color: #ffffff !important;
}

html:not([data-theme="dark"]) table td,
html:not([data-theme="dark"]) table th {
    border-color: #e2e8f0 !important;
}

html:not([data-theme="dark"]) table .text-nexo-cyan {
    color: #2563eb !important;
}

/* 기능 카드 */
html:not([data-theme="dark"]) .bg-slate-900.border.border-slate-800 {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

html:not([data-theme="dark"]) .hover\:bg-slate-800\/80:hover {
    background: #f1f5f9 !important;
}

/* 아이콘 박스 */
html:not([data-theme="dark"]) .bg-slate-800.rounded-xl,
html:not([data-theme="dark"]) .bg-slate-800.rounded-2xl {
    background: #f1f5f9 !important;
}

html:not([data-theme="dark"]) .group-hover\:bg-nexo-cyan {
    /* 호버 시 블루로 */
}

html:not([data-theme="dark"]) .group:hover .group-hover\:bg-nexo-cyan {
    background: #2563eb !important;
}

html:not([data-theme="dark"]) .group:hover .group-hover\:text-nexo-navy {
    color: #ffffff !important;
}

/* 제품 이미지 영역 */
html:not([data-theme="dark"]) .min-h-80.bg-slate-900 {
    background: #f8fafc !important;
}

/* 관리자 버튼 */
html:not([data-theme="dark"]) #adminButton {
    background: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}

html:not([data-theme="dark"]) #adminButton:hover {
    background: #cbd5e1 !important;
}


/* =============================================
   테마 토글 버튼
   ============================================= */
.theme-toggle {
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    border: none;
    background: transparent;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.theme-toggle:hover {
    background: rgba(255,255,255,0.1);
    color: #06b6d4;
}

/* 아이콘 전환 */
html:not([data-theme="dark"]) .theme-icon-dark { display: none; }
html:not([data-theme="dark"]) .theme-icon-light { display: block; }
html[data-theme="dark"] .theme-icon-dark { display: block; }
html[data-theme="dark"] .theme-icon-light { display: none; }

/* 전환 애니메이션 */
body, .bg-slate-800, .bg-slate-900, .bg-nexo-navy, .bg-nexo-dark {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* =============================================
   모바일 최적화 - 더 많은 콘텐츠 표시
   ============================================= */
@media (max-width: 640px) {
    /* --- 전체 텍스트 정리 --- */
    body {
        font-size: 14px !important;
    }

    /* 페이지 타이틀 */
    h1.text-4xl, h1.text-5xl, h1.text-6xl,
    h1[class*="text-4xl"], h1[class*="text-5xl"] {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.5rem !important;
    }

    /* 페이지 서브 타이틀 */
    h2.text-3xl, h2.text-4xl, h2.text-5xl,
    h3.text-4xl, h3.text-3xl {
        font-size: 1.25rem !important;
        line-height: 1.3 !important;
    }

    /* 섹션 타이틀 */
    h3.text-2xl {
        font-size: 1rem !important;
        margin-bottom: 0.75rem !important;
    }

    /* 섹션 소제목 아이콘 */
    h3 i.w-6.h-6 {
        width: 1.1rem !important;
        height: 1.1rem !important;
    }

    /* 페이지 설명 */
    p.text-lg {
        font-size: 0.8rem !important;
        line-height: 1.5 !important;
        margin-bottom: 1rem !important;
    }

    /* 영문 서브헤더 */
    h2.text-sm, .tracking-widest.text-sm {
        font-size: 0.65rem !important;
        margin-bottom: 0.25rem !important;
    }

    /* 페이지 상단 여백 축소 */
    .pt-32 {
        padding-top: 5rem !important;
    }

    .text-center.mb-16 {
        margin-bottom: 1.5rem !important;
    }

    .text-center.mb-8 {
        margin-bottom: 1rem !important;
    }

    /* --- 카드 내부 --- */
    .rounded-2xl.p-6 {
        padding: 0.75rem !important;
    }

    .rounded-2xl.p-8 {
        padding: 1rem !important;
    }

    /* 아이콘 박스 축소 */
    .w-16.h-16 {
        width: 2.25rem !important;
        height: 2.25rem !important;
        margin-bottom: 0.5rem !important;
    }

    .w-16.h-16 i {
        width: 1.1rem !important;
        height: 1.1rem !important;
    }

    /* 카드 제목 */
    .rounded-2xl h4.text-lg {
        font-size: 0.75rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.15rem !important;
    }

    /* 카드 설명 */
    .rounded-2xl p.text-sm,
    .rounded-2xl p.text-xs {
        font-size: 0.6rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.4rem !important;
    }

    /* 다운로드 링크 */
    .rounded-2xl a.text-nexo-cyan,
    a.inline-flex.items-center {
        font-size: 0.65rem !important;
    }

    a.inline-flex i.w-4.h-4 {
        width: 0.7rem !important;
        height: 0.7rem !important;
    }

    /* 넘버 뱃지 */
    .absolute.top-4.right-4.w-8.h-8 {
        width: 1.1rem !important;
        height: 1.1rem !important;
        top: 0.4rem !important;
        right: 0.4rem !important;
        font-size: 0.55rem !important;
    }

    /* --- 버튼 --- */
    button.rounded-full, a.rounded-full {
        font-size: 0.8rem !important;
        padding: 0.5rem 1.25rem !important;
    }

    /* --- 섹션 간격 축소 --- */
    .space-y-12 > * + * {
        margin-top: 1.5rem !important;
    }

    .space-y-16 > * + * {
        margin-top: 2rem !important;
    }

    .py-24 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }

    .py-16 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .mb-16 {
        margin-bottom: 1.5rem !important;
    }

    .mb-12 {
        margin-bottom: 1rem !important;
    }

    /* --- 네비게이션 카드 --- */
    #nav-cards-placeholder .rounded-2xl {
        padding: 0.4rem !important;
    }

    #nav-cards-placeholder h5 {
        font-size: 0.6rem !important;
    }

    #nav-cards-placeholder .w-12.h-12 {
        width: 1.75rem !important;
        height: 1.75rem !important;
        margin-bottom: 0.2rem !important;
    }

    #nav-cards-placeholder .w-12.h-12 i {
        width: 0.9rem !important;
        height: 0.9rem !important;
    }

    #nav-cards-placeholder h4 {
        font-size: 1rem !important;
    }

    /* --- 검색바 --- */
    input[type="text"] {
        font-size: 0.8rem !important;
        padding: 0.6rem 0.8rem 0.6rem 2.5rem !important;
    }

    /* --- FAQ --- */
    .faq-btn span {
        font-size: 0.8rem !important;
    }

    .faq-content {
        font-size: 0.75rem !important;
        padding: 0.75rem !important;
    }

    /* --- 설치사례 카드 텍스트 --- */
    .case-card .p-3 {
        padding: 0.35rem !important;
    }

    .case-card p.text-sm {
        font-size: 0.65rem !important;
    }

    .case-card p.text-xs {
        font-size: 0.55rem !important;
    }

    /* --- 히어로 섹션 --- */
    section.bg-slate-900 .text-3xl {
        font-size: 1.5rem !important;
    }

    /* Key Feature 뱃지 */
    .text-3xl.font-black {
        font-size: 1.1rem !important;
    }

    .text-xs.text-slate-400 {
        font-size: 0.55rem !important;
    }

    /* --- 푸터 모바일 --- */
    footer h2 {
        font-size: 1.2rem !important;
        line-height: 1.4 !important;
    }

    footer .grid {
        gap: 0.5rem !important;
    }

    footer .rounded-xl.p-6 {
        padding: 0.75rem !important;
    }

    footer h4 {
        font-size: 0.8rem !important;
    }

    footer p {
        font-size: 0.65rem !important;
    }

    footer i.w-8.h-8 {
        width: 1.25rem !important;
        height: 1.25rem !important;
        margin-bottom: 0.25rem !important;
    }
}
