/* =============================================
   Supplement Price Comparison Platform
   Modern, Clean, Professional Design
   ============================================= */

:root {
    --primary: #667eea;
    --primary-dark: #764ba2;
    --secondary: #f093fb;
    --success: #06d6a0;
    --danger: #ef476f;
    --warning: #ffd166;
    --info: #118ab2;
    --light: #f8f9fa;
    --dark: #2d3436;
    --gray: #95a5a6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #fafbfc;
    color: var(--dark);
    line-height: 1.6;
}

/* =============================================
   Navigation
   ============================================= */

.navbar {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
}

.navbar-brand {
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.navbar-brand i {
    margin-right: 8px;
}

/* =============================================
   Hero Section
   ============================================= */

.hero-section {
    min-height: 400px;
    display: flex;
    align-items: center;
}

.big-icon {
    font-size: 120px;
    opacity: 0.2;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(20px); }
}

/* =============================================
   Search Card
   ============================================= */

.search-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.search-card .form-control {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.search-card .btn-primary {
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    transition: all 0.3s ease;
}

.search-card .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.4);
}

/* =============================================
   Feature Cards
   ============================================= */

.feature-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.feature-icon {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 16px;
}

.feature-card h5 {
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--dark);
}

/* =============================================
   Product Cards
   ============================================= */

.product-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.product-brand {
    font-weight: 700;
    color: var(--gray);
    margin: 0;
    font-size: 0.875rem;
}

.product-retailer {
    display: flex;
    gap: 6px;
}

.product-name {
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 12px;
    font-size: 1.1rem;
    line-height: 1.4;
}

.product-specs {
    display: flex;
    gap: 12px;
    font-size: 0.875rem;
    margin-bottom: 12px;
}

.product-specs div {
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-price {
    padding: 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 8px;
    margin: auto 0 16px 0;
}

.price-label {
    font-size: 0.875rem;
    color: var(--gray);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.price-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 4px;
}

/* =============================================
   Price Comparison Table
   ============================================= */

.comparison-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e0e0;
}

.comparison-table table {
    margin: 0;
}

.comparison-table thead {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.comparison-table th {
    padding: 16px;
    font-weight: 700;
    text-align: left;
    border: none;
}

.comparison-table td {
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.comparison-table tbody tr:last-child td {
    border-bottom: none;
}

.comparison-table tbody tr:hover {
    background-color: #f8f9fa;
}

.retailer-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    display: inline-block;
}

/* =============================================
   Nutrition Info
   ============================================= */

.nutrition-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--primary);
}

.nutrition-name {
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.nutrition-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.nutrition-percentage {
    font-size: 0.875rem;
    color: var(--gray);
    margin-top: 4px;
}

.progress-bar-warning {
    background-color: #ffc107 !important;
}

.progress-bar-success {
    background-color: #28a745 !important;
}

.progress-bar-danger {
    background-color: #dc3545 !important;
}

/* =============================================
   Buttons & Forms
   ============================================= */

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.4);
}

.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary-dark);
    color: white;
}

.form-check-input {
    border-radius: 4px;
    border: 2px solid #d0d0d0;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* =============================================
   Alerts
   ============================================= */

.alert {
    border-radius: 12px;
    border: none;
    padding: 16px;
}

.alert-info {
    background-color: rgba(17, 138, 178, 0.1);
    color: var(--info);
}

.alert-warning {
    background-color: rgba(255, 209, 102, 0.1);
    color: #856404;
}

.alert-danger {
    background-color: rgba(239, 71, 111, 0.1);
    color: #721c24;
}

.alert-success {
    background-color: rgba(6, 214, 160, 0.1);
    color: #155724;
}

/* =============================================
   Badge
   ============================================= */

.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
}

/* =============================================
   Footer
   ============================================= */

footer {
    border-top: 1px solid #e0e0e0;
}

footer h6 {
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 12px;
}

footer a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* =============================================
   Loading Spinner
   ============================================= */

.spinner-border {
    color: var(--primary) !important;
    width: 48px;
    height: 48px;
}

/* =============================================
   Responsive Design
   ============================================= */

@media (max-width: 768px) {
    .hero-section {
        min-height: 300px;
    }

    .big-icon {
        font-size: 80px;
    }

    .display-4 {
        font-size: 2rem;
    }

    .search-card {
        padding: 20px;
    }

    .feature-card {
        padding: 20px;
    }

    .product-card {
        padding: 16px;
    }

    .product-price {
        padding: 12px;
    }
}

/* =============================================
   Animations
   ============================================= */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeIn 0.5s ease-out;
}

/* =============================================
   Scrollbar
   ============================================= */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* =============================================
   Responsive Design — 개선(모바일 마감, v-stage1)
   360/390/412px 휴대폰 · 768px 태블릿 대응 강화
   ============================================= */

/* 가로 스크롤(넘침) 방지 공통 */
img, table { max-width: 100%; }
.article-body { overflow-wrap: break-word; word-break: keep-all; }
.article-body img { max-width: 100%; height: auto; }
/* 가이드 본문에 표가 들어오면 좁은 화면에서 좌우 스크롤 */
.article-body table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 태블릿 이하 */
@media (max-width: 768px) {
    h1, h2, h3 { word-break: keep-all; }
    .offer-total { font-size: 1.4rem; }
}

/* 휴대폰(작은 화면) */
@media (max-width: 576px) {
    .display-4 { font-size: 1.6rem; }
    .hero-section { min-height: auto; padding: 24px 0; }
    .hero-section .lead { font-size: 1rem; }
    .big-icon { font-size: 64px; }
    .navbar-brand { font-size: 1.05rem; }
    .search-card { padding: 16px; }
    .feature-card, .product-card { padding: 16px; }
    .offer-total { font-size: 1.25rem; }
    .price-value { font-size: 1.25rem; }

    /* 손가락 터치 영역 확대(주요 버튼/링크) */
    .btn { min-height: 44px; }
    .navbar .nav-link { padding-top: 10px; padding-bottom: 10px; }

    /* 좌우 여백 살짝 확보 */
    .container-lg, .container { padding-left: 14px; padding-right: 14px; }

    /* 표는 좌우 스크롤로 넘침 방지 */
    .table-responsive-sm { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
