:root {
    --primary-color: #4A90E2; /* Soft Blue for Trust */
    --secondary-color: #50E3C2; /* Teal Accent */
    --background-color: #F9F9FA; /* Clean Off-White */
    --surface-color: #FFFFFF; /* White Cards */
    --text-primary: #2C3E50; /* Dark Blue-Gray */
    --text-secondary: #7F8C8D; /* Muted Gray */
    --border-color: #E1E8ED;
    --success-color: #27AE60;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    word-break: keep-all; /* Proper Korean word wrapping */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
header {
    background-color: var(--surface-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links a {
    margin-left: 20px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #fff 0%, #f0f4f8 100%);
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

#searchInput {
    width: 100%;
    padding: 16px 24px;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

#searchInput:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Market Grid */
.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

.market-card {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.market-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.card-header {
    height: 120px;
    background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: bold;
}

.card-body {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.market-title {
    font-size: 1.25rem;
    margin: 0 0 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
}

.market-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
    flex-grow: 1;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-align: center;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: #357abd;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: rgba(74, 144, 226, 0.05);
}

/* Detailed Page Styles */
.detail-header {
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.url-box {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: monospace;
    word-break: break-all;
}

.copy-btn {
    background: white;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-left: 12px;
    flex-shrink: 0;
    font-family: inherit;
}

.copy-btn:active {
    background: #f0f0f0;
}

/* Content Section */
.content-section {
    background: var(--surface-color);
    padding: 40px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 40px;
}

.content-section h2 {
    border-left: 4px solid var(--primary-color);
    padding-left: 16px;
    margin-bottom: 24px;
}

/* Breadcrumbs */
.breadcrumbs {
    margin: 20px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumbs span {
    margin: 0 8px;
}

/* FAQ */
.faq-item {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.faq-question {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

/* Footer */
footer {
    background-color: #2C3E50;
    color: white;
    padding: 60px 0 20px;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col li {
    margin-bottom: 12px;
}

.footer-col a {
    color: #bdc3c7;
    text-decoration: none;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #7f8c8d;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .market-grid {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .nav-links {
        display: none; /* Simplify for mobile for now */
    }
}
