/* ---------------------------------------------------------
   1. Global Variables & Reset
--------------------------------------------------------- */
:root {
    --navy: #0a192f;
    --gold: #f39c12;
    --blue: #1976d2;
    --light-gray: #f8f9fa;
    --border-color: #dee2e6;
    --text-main: #2d3436;
    --text-muted: #636e72;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f1f3f6;
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    text-decoration: none;
    transition: 0.3s;
    color: inherit;
}

/* ---------------------------------------------------------
   2. Navigation (Top Bar)
--------------------------------------------------------- */
.main-header, .top-bar {
    background: white;
    height: 70px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container, .top-bar-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 20px;
}

.nav-logo, .bar-logo img {
    height: 38px;
    width: auto;
    display: block;
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 25px;
}

.top-nav a {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.top-nav a:hover {
    color: var(--blue);
}

.back-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--blue);
}

/* ---------------------------------------------------------
   3. Hero Section (Home Page)
--------------------------------------------------------- */
.hero-section {
    background: var(--navy);
    color: white;
    padding: 80px 20px 100px;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: -1px;
}

.hero-content p {
    font-size: 1.1rem;
    opacity: 0.7;
    margin-bottom: 40px;
}

/* Search Box */
.search-form {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.search-box-wrapper {
    background: white;
    border-radius: 50px;
    display: flex;
    padding: 5px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.search-icon {
    color: #aaa;
    padding: 15px 20px;
    font-size: 1.1rem;
}

.search-box-wrapper input {
    border: none;
    flex: 1;
    padding: 10px;
    font-size: 1rem;
    outline: none;
    border-radius: 50px;
    color: var(--text-main);
    min-width: 0;
}

.search-box-wrapper button {
    background: var(--blue);
    color: white;
    border: none;
    padding: 0 30px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box-wrapper button:hover {
    background: #0d47a1;
}

.trending-tags {
    margin-top: 25px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
}

.trending-tags span { margin-right: 5px; }

.trending-tags a {
    color: var(--gold);
    margin: 0 5px;
}

/* ---------------------------------------------------------
   4. Recent Uploads (Home Page)
--------------------------------------------------------- */
.recent-uploads {
    margin-top: 60px;
    text-align: left;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.recent-uploads h3 {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.recent-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.mini-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.3s;
    color: white;
}

.mini-card:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-3px);
}

.mini-card-info {
    display: flex;
    flex-direction: column;
}

.mini-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.mini-loc {
    color: rgba(255,255,255,0.5);
    font-size: 0.75rem;
    margin-top: 3px;
}

.mini-card i {
    color: var(--gold);
    font-size: 0.8rem;
}

/* ---------------------------------------------------------
   5. Content Area (Search Results)
--------------------------------------------------------- */
.content-area {
    flex: 1;
    max-width: 1100px;
    margin: 40px auto 80px;
    padding: 0 20px;
    width: 100%;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
}

.results-header h2 {
    font-size: 1.4rem;
    color: var(--navy);
    margin: 0;
}

.count-badge {
    background: white;
    border: 1px solid var(--blue);
    color: var(--blue);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.company-card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: 0.3s;
}

.company-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    border-color: var(--blue);
}

.card-body {
    padding: 25px;
    flex: 1;
}

.country-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: #adb5bd;
    letter-spacing: 1.5px;
    display: block;
    margin-bottom: 8px;
}

.company-card h3 {
    margin: 5px 0;
    font-size: 1.25rem;
}

.company-card h3 a {
    color: var(--navy);
}

.en-name {
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.location {
    font-size: 0.85rem;
    color: #999;
}

.card-footer {
    background: #fafafa;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
}

.subsidy-badge {
    font-size: 0.75rem;
    color: #27ae60;
    font-weight: 700;
}

.view-btn {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--blue);
}

/* ---------------------------------------------------------
   6. Features Grid (Home)
--------------------------------------------------------- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 60px;
}

.feature-item {
    background: white;
    padding: 50px 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    text-align: center;
    border: 1px solid #eee;
    transition: 0.3s;
}

.feature-item:hover {
    transform: translateY(-10px);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background: #f0f7ff;
    color: var(--blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 25px;
}

.feature-item h3 {
    font-size: 1.3rem;
    color: var(--navy);
    margin-bottom: 15px;
    font-weight: 700;
}

.feature-item p {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
}

/* ---------------------------------------------------------
   7. Detail Page (Report Layout)
--------------------------------------------------------- */
.report-main-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.report-hero {
    background: var(--navy);
    color: white;
    padding: 60px 50px;
    border-radius: 12px 12px 0 0;
}

.confidential-tag, .report-badge {
    background: var(--gold);
    color: var(--navy);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.company-name-en, .comp-en-name {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 20px 0 5px 0;
}

.company-name-jp, .comp-jp-name {
    font-size: 1.1rem;
    opacity: 0.6;
    font-weight: 400;
    margin-bottom: 30px;
}

.metadata-row, .meta-data-grid {
    display: flex;
    gap: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 25px;
}

.meta-item {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.8);
}

.meta-item i { color: var(--gold); }

/* Report Content Card */
.report-content-card, .markdown-content {
    background: white;
    padding: 60px 80px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.report-type {
    font-size: 0.8rem;
    color: #999;
    letter-spacing: 2px;
    font-weight: 600;
}

.accent-line {
    width: 50px;
    height: 3px;
    background: var(--gold);
    margin: 10px 0 40px 0;
}

/* Typography for Report */
.markdown-body {
    line-height: 1.8;
    font-size: 1.1rem;
    color: #333;
}

.markdown-body h2 {
    font-size: 1.7rem;
    color: var(--navy);
    margin-top: 50px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.markdown-body h3 {
    font-size: 1.3rem;
    color: var(--blue);
    margin-top: 30px;
}

.markdown-body p { margin-bottom: 25px; text-align: left; }

.markdown-body ul, .markdown-body ol {
    margin-bottom: 25px; padding-left: 20px;
}

.markdown-body li { margin-bottom: 10px; }

/* ---------------------------------------------------------
   8. Floating Widget
--------------------------------------------------------- */
.floating-widget, .floating-contact-box {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    overflow: hidden;
    border: 1px solid #eee;
    z-index: 2000;
}

.widget-header, .floating-header {
    background: var(--navy);
    color: white;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: bold;
}

.close-btn {
    background: none; border: none; color: white; font-size: 1.2rem; cursor: pointer;
}

.widget-body, .floating-body { padding: 20px; }
.widget-body p, .floating-body p { font-size: 0.85rem; color: #666; margin-bottom: 15px; }

.btn-prep, .btn-preparing {
    width: 100%;
    background: #f1f3f5;
    color: #adb5bd;
    border: 1px solid #dee2e6;
    padding: 12px;
    border-radius: 6px;
    font-weight: bold;
    cursor: not-allowed;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-verify, .btn-google-sm {
    display: block;
    text-align: center;
    padding: 10px;
    font-size: 0.8rem;
    color: var(--blue);
    text-decoration: none;
    border: 1px solid #e3f2fd;
    border-radius: 6px;
    font-weight: 600;
}

.btn-verify:hover { background: #f1f8ff; }

/* ---------------------------------------------------------
   9. Footer
--------------------------------------------------------- */
.main-footer, .page-footer {
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 40px 20px;
    margin-top: auto;
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-info p {
    color: #999;
    font-size: 0.85rem;
    margin: 0;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    font-size: 0.85rem;
    color: var(--blue);
}

.footer-links a:hover {
    text-decoration: underline;
}

/* ---------------------------------------------------------
   10. Mobile Responsive
--------------------------------------------------------- */
@media (max-width: 768px) {
    .hero-content h1 { font-size: 1.8rem; }
    .results-grid { grid-template-columns: 1fr; }
    .features-grid { grid-template-columns: 1fr; }
    .footer-container { flex-direction: column; gap: 20px; text-align: center; }
    
    .report-hero { padding: 40px 25px; }
    .company-name-en { font-size: 1.8rem; }
    .metadata-row { flex-direction: column; gap: 10px; }
    .report-content-card { padding: 40px 25px; }
    .markdown-content { padding: 30px 20px; }
    .floating-widget { width: calc(100% - 40px); left: 20px; bottom: 20px; }

    .markdown-body {
        font-size: 1rem;
        line-height: 1.7;
    }
    .markdown-body p {
        text-align: left;
    }
    .markdown-body h2 {
        font-size: 1.5rem;
    }
    .markdown-body h3 {
        font-size: 1.2rem;
    }
}

/* --- Recent Section (White Background Version) --- */
.recent-section {
    margin-bottom: 80px;
}

.section-header h3 {
    font-size: 1.1rem;
    color: var(--navy);
    font-weight: 800;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.recent-grid-white {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.recent-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    position: relative;
    overflow: hidden;
}

.recent-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    border-color: var(--blue);
}

.recent-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #e3f2fd;
    color: var(--blue);
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
}

.recent-card h4 {
    font-size: 1rem;
    color: var(--text-main);
    margin: 5px 0 10px 0;
    font-weight: 700;
    line-height: 1.4;
}

.recent-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 15px;
    flex: 1;
}

.recent-meta {
    font-size: 0.75rem;
    color: #999;
    border-top: 1px solid #f1f1f1;
    padding-top: 10px;
}

@media (max-width: 1024px) {
    .recent-grid-white { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .recent-grid-white { grid-template-columns: 1fr; }
    
    .recent-sub {
        flex: initial;
    }
}

/* --- DB Status Bar (Hero Section) --- */
.db-status-bar {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.status-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-item strong {
    color: var(--gold);
    font-weight: 700;
}

.status-item.highlight {
    background: rgba(243, 156, 18, 0.2);
    border-color: var(--gold);
    color: var(--gold);
    font-weight: 600;
}

@media (max-width: 600px) {
    .db-status-bar {
        gap: 10px;
    }
    .status-item {
        font-size: 0.75rem;
        padding: 6px 12px;
    }
}

/* ▼▼▼ [수정됨] 찾아보기 섹션 스타일 추가 ▼▼▼ */
.browse-section {
    margin-top: 80px;
    margin-bottom: 80px;
}

.browse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.browse-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.browse-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    border-color: var(--blue);
    color: var(--blue);
}
/* ▲▲▲ [수정됨] 끝 ▲▲▲ */