/* 만두 가격비교 전문 사이트 - 전역 스타일 */

/* 브랜드 컬러 변수 */
:root {
    --primary-color: #FF6B35;
    --primary-hover: #E85A2A;
    --secondary-color: #F7931E;
    --success-color: #03C75A;
    --danger-color: #E63946;
    --text-dark: #2C3E50;
    --text-gray: #6C757D;
    --bg-light: #F8F9FA;
    --border-color: #DEE2E6;
    --shadow-sm: 0 2px 8px rgba(255, 107, 53, 0.1);
    --shadow-md: 0 4px 12px rgba(255, 107, 53, 0.15);
    --shadow-lg: 0 8px 24px rgba(255, 107, 53, 0.2);
}

/* 히어로 섹션 */
.hero-section {
    background: linear-gradient(135deg, #FFF5F0 0%, #FFFFFF 50%, #FFF5F0 100%);
    color: var(--text-dark);
    padding: 40px 32px;
    text-align: center;
    margin-bottom: 32px;
    border-radius: 16px;
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow-md);
}

.hero-section h2 {
    font-size: 1.75rem;
    margin-bottom: 12px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-dark);
}

.hero-section p {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.6;
    color: var(--text-gray);
}

/* 앱 탭 */
.app-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding: 8px;
    background: var(--bg-light);
    border-radius: 10px;
}

.app-tab {
    padding: 12px 24px;
    border-radius: 8px;
    color: var(--bg-light);
    font-weight: 700;
    cursor: pointer !important;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.9375rem;
    letter-spacing: 0;
    border: none;
    background: transparent;
    text-decoration: none;
    position: relative;
}

.app-tab.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
    transform: translateY(0);
}

.app-tab:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(0);
}

.app-tab:active {
    transform: translateY(0);
}

/* 퀴즈 카드 */
.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.quiz-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid var(--border-color);
}

.quiz-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
    transform: translateY(-4px);
}

.quiz-card-header {
    padding: 16px 20px;
    color: white;
    position: relative;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
}

.quiz-card-date {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-bottom: 4px;
}

.quiz-card-app {
    font-size: 1rem;
    font-weight: 700;
}

.quiz-card-today {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,255,255,0.25);
    padding: 3px 8px;
    border-radius: 2px;
    font-size: 0.6875rem;
    font-weight: 600;
}

.quiz-card-body {
    padding: 16px;
}

.quiz-question {
    font-weight: 600;
    color: #222;
    margin-bottom: 12px;
    font-size: 0.875rem;
    line-height: 1.5;
    letter-spacing: 0;
}

.quiz-answer {
    background: #fafafa;
    padding: 12px 14px;
    border-radius: 2px;
    border-left: 3px solid;
    margin-bottom: 12px;
    transition: all 0.15s ease;
}

.quiz-answer:hover {
    background: #f5f5f5;
}

.quiz-answer-label {
    font-size: 0.6875rem;
    color: #666;
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.quiz-answer-text {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #000;
    letter-spacing: 0;
}

.quiz-card-image {
    margin: 10px 0;
    border-radius: 2px;
    overflow: hidden;
}

.quiz-card-image img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.quiz-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
    font-size: 0.75rem;
    color: #999;
}

.quiz-views {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 퀴즈 테이블 */
.quiz-table-wrapper {
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.quiz-table {
    width: 100%;
    border-collapse: collapse;
}

.quiz-table thead {
    background: linear-gradient(to bottom, #fafafa, #f5f5f5);
    border-bottom: 2px solid #d0d0d0;
}

.quiz-table th {
    padding: 14px 18px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 800;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.quiz-table tbody tr {
    border-bottom: 1px solid #e5e5e5;
    background: #fff;
    transition: all 0.2s ease;
}

.quiz-table tbody tr:nth-child(even) {
    background: #fafafa;
}

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

.quiz-row {
    cursor: pointer !important;
}

.quiz-row:hover {
    background: #f0f0f0 !important;
    box-shadow: inset 0 0 0 1px #e0e0e0;
    transform: scale(1.001);
}

.quiz-row:active {
    background: #e8e8e8 !important;
}

.quiz-table td {
    padding: 16px 18px;
    font-size: 0.8125rem;
    color: #222;
    vertical-align: middle;
    font-weight: 500;
}

.quiz-app-badge {
    display: inline-block;
    padding: 5px 12px;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: 2px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: all 0.15s ease;
}

.quiz-row:hover .quiz-app-badge {
    box-shadow: 0 2px 5px rgba(0,0,0,0.25);
    transform: translateY(-1px);
}

.quiz-title-cell {
    color: #555;
    font-weight: 500;
}

.quiz-row:hover .quiz-title-cell {
    color: #222;
}

.quiz-question-cell {
    font-weight: 600;
    color: #222;
    transition: color 0.15s ease;
}

.quiz-row:hover .quiz-question-cell {
    color: #000;
}

.quiz-question-cell i {
    margin-right: 8px;
    color: #999;
    font-size: 0.75rem;
    transition: color 0.15s ease;
}

.quiz-row:hover .quiz-question-cell i {
    color: #666;
}

.quiz-time-cell,
.quiz-views-cell {
    text-align: center;
    color: #666;
    font-size: 0.75rem;
    font-weight: 500;
}

.quiz-row:hover .quiz-time-cell,
.quiz-row:hover .quiz-views-cell {
    color: #333;
    font-weight: 600;
}

/* 섹션 헤더 */
.section {
    margin-bottom: 48px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a1a;
    position: relative;
    padding-left: 12px;
    letter-spacing: -0.3px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background: #1a1a1a;
    border-radius: 1px;
}

.section-link {
    color: #555;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8125rem;
    transition: all 0.2s ease;
    padding: 6px 12px;
    border-radius: 2px;
    cursor: pointer;
}

.section-link:hover {
    color: #000;
    gap: 8px;
    background: #f5f5f5;
}

.section-link:active {
    background: #e8e8e8;
}

/* 할인 카드 */
.discount-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.discount-card {
    background: #fff;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    border: 1px solid #d0d0d0;
    cursor: pointer;
}

.discount-card:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    border-color: #b0b0b0;
    transform: translateY(-4px);
}

.discount-card:active {
    transform: translateY(-2px);
}

.discount-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.discount-body {
    padding: 16px;
}

.discount-source {
    font-size: 0.6875rem;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.discount-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: #222;
    font-size: 0.875rem;
    line-height: 1.4;
    letter-spacing: 0;
}

.discount-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}

.discount-rate {
    font-size: 1.125rem;
    font-weight: 700;
    color: #d32f2f;
}

.discount-sale-price {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #000;
}

.discount-original-price {
    font-size: 0.75rem;
    color: #999;
    text-decoration: line-through;
}

.discount-period {
    font-size: 0.75rem;
    color: #666;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 통신사 비교 테이블 */
.compare-table {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.compare-table th {
    background: #f8f9fa;
    font-weight: 600;
    text-align: center;
}

.compare-table td {
    text-align: center;
}

.plan-name {
    font-weight: 600;
    color: #333;
}

.plan-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #FF6B6B;
}

.plan-provider-skt {
    color: #e63946;
}

.plan-provider-kt {
    color: #f77f00;
}

.plan-provider-lg {
    color: #9d4edd;
}

/* 커뮤니티 리스트 */
.community-list {
    background: #fff;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #d0d0d0;
}

.community-item {
    padding: 18px 20px;
    border-bottom: 1px solid #e5e5e5;
    transition: all 0.2s ease;
    cursor: pointer;
}

.community-item:last-child {
    border-bottom: none;
}

.community-item:hover {
    background: #f0f0f0;
    padding-left: 24px;
    box-shadow: inset 4px 0 0 #000;
}

.community-category {
    display: inline-block;
    padding: 4px 10px;
    background: #000;
    color: #fff;
    border-radius: 2px;
    font-size: 0.6875rem;
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: all 0.15s ease;
}

.community-item:hover .community-category {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.25);
}

.community-title {
    font-weight: 600;
    color: #222;
    margin-bottom: 10px;
    font-size: 0.875rem;
    letter-spacing: 0;
    line-height: 1.4;
    transition: color 0.15s ease;
}

.community-item:hover .community-title {
    color: #000;
    font-weight: 700;
}

.community-meta {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: #666;
    transition: color 0.15s ease;
}

.community-item:hover .community-meta {
    color: #333;
    font-weight: 500;
}

.community-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 로딩 */
.loading {
    text-align: center;
    padding: 32px;
    color: #999;
}

/* 빈 상태 */
.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: #999;
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 0.9375rem;
}

/* 반응형 */
@media (max-width: 1024px) {
    .container {
        padding: 0 14px;
    }

    .quiz-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .discount-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }

    /* 앱 탭 스크롤 */
    .app-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .app-tabs::-webkit-scrollbar {
        display: none;
    }
}

@media (max-width: 900px) {
    /* 히어로 섹션 */
    .hero-section {
        padding: 32px 24px;
        margin-bottom: 24px;
    }

    .hero-section h2 {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }

    .hero-section p {
        font-size: 0.875rem;
    }

    /* 섹션 헤더 */
    .section-header {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .section-title {
        font-size: 1rem;
    }

    /* 앱 탭 - 모바일 최적화 (줄바꿈 가능) */
    .app-tabs {
        gap: 6px;
        margin-bottom: 16px;
        padding: 0;
        overflow: visible;
        flex-wrap: wrap;
        white-space: normal;
    }

    .app-tab {
        padding: 10px 16px;
        font-size: 0.875rem;
        min-width: auto;
        text-align: center;
        flex-shrink: 0;
    }

    /* 퀴즈 그리드/테이블 */
    .quiz-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .quiz-table-wrapper {
        overflow: hidden;
        margin: 0;
        width: 100%;
        border-radius: 2px;
    }

    .quiz-table {
        width: 100%;
        table-layout: fixed;
        border-collapse: collapse;
    }

    .quiz-table th,
    .quiz-table td {
        padding: 12px 6px;
        font-size: 0.75rem;
    }

    /* 날짜 컬럼 숨김 (모바일에서) */
    .quiz-table th:nth-child(2),
    .quiz-table td:nth-child(2) {
        display: none;
    }

    /* 퀴즈 제목 컬럼 숨김 (모바일에서는 문제만 표시) */
    .quiz-table th:nth-child(3),
    .quiz-table td:nth-child(3) {
        display: none;
    }

    /* 컬럼 너비 조정 - 앱, 문제, 시간, 조회만 표시 */
    .quiz-table th:nth-child(1),
    .quiz-table td:nth-child(1) {
        width: 70px;
        padding-left: 10px;
    }

    .quiz-table th:nth-child(4),
    .quiz-table td:nth-child(4) {
        width: auto;
        max-width: 0;
    }

    .quiz-table th:nth-child(5),
    .quiz-table td:nth-child(5) {
        width: 50px;
        text-align: center;
        padding: 12px 4px;
    }

    .quiz-table th:nth-child(6),
    .quiz-table td:nth-child(6) {
        width: 50px;
        text-align: center;
        padding-right: 10px;
    }

    .quiz-question-cell {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 0;
    }

    .quiz-question-cell i {
        display: none;
    }

    /* 할인 그리드 */
    .discount-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* 섹션 */
    .section {
        margin-bottom: 32px;
    }

    .section-header {
        margin-bottom: 16px;
    }

    .section-title {
        font-size: 1.125rem;
        padding-left: 10px;
    }

    .section-title::before {
        width: 2px;
        height: 14px;
    }

    .section-link {
        font-size: 0.75rem;
        padding: 5px 10px;
    }

    /* 커뮤니티 아이템 */
    .community-item {
        padding: 14px 16px;
    }

    .community-item:hover {
        padding-left: 20px;
    }

    .community-title {
        font-size: 0.8125rem;
    }

    .community-meta {
        font-size: 0.6875rem;
    }
}

/* 768px - 모바일 최적화 */
@media (max-width: 768px) {
    /* 히어로 섹션 - 슬림화 */
    .hero-section {
        padding: 16px 14px;
        margin-bottom: 12px;
        border-radius: 10px;
    }

    .hero-section h2 {
        font-size: 1.125rem;
        margin-bottom: 4px;
    }

    .hero-section p {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    /* 히어로 섹션 - 더 슬림 */
    .hero-section {
        padding: 12px 12px;
        margin-bottom: 10px;
    }

    .hero-section h2 {
        font-size: 1rem;
        margin-bottom: 3px;
    }

    .hero-section p {
        font-size: 0.6875rem;
    }

    /* 앱 탭 - 480px에서도 줄바꿈 */
    .app-tabs {
        gap: 6px;
        margin-bottom: 16px;
        flex-wrap: wrap;
    }

    .app-tab {
        padding: 9px 14px;
        font-size: 0.8125rem;
        min-width: auto;
        letter-spacing: 0.2px;
    }

    /* 할인 그리드 */
    .discount-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* 퀴즈 테이블 */
    .quiz-table-wrapper {
        margin: 0;
        width: 100%;
    }

    .quiz-table th,
    .quiz-table td {
        padding: 10px 4px;
        font-size: 0.6875rem;
    }

    /* 컬럼 너비 더 축소 */
    .quiz-table th:nth-child(1),
    .quiz-table td:nth-child(1) {
        width: 65px;
        padding-left: 8px;
    }

    .quiz-table th:nth-child(5),
    .quiz-table td:nth-child(5),
    .quiz-table th:nth-child(6),
    .quiz-table td:nth-child(6) {
        width: 45px;
        padding: 10px 2px;
    }

    .quiz-table th:nth-child(6),
    .quiz-table td:nth-child(6) {
        padding-right: 8px;
    }

    /* 퀴즈 카드 */
    .quiz-card-header {
        padding: 10px 14px;
    }

    .quiz-card-date {
        font-size: 0.6875rem;
    }

    .quiz-card-app {
        font-size: 0.9375rem;
    }

    .quiz-card-body {
        padding: 14px;
    }

    .quiz-question {
        font-size: 0.8125rem;
        margin-bottom: 10px;
    }

    .quiz-answer {
        padding: 10px 12px;
    }

    .quiz-answer-label {
        font-size: 0.625rem;
    }

    .quiz-answer-text {
        font-size: 0.875rem;
    }

    /* 섹션 */
    .section {
        margin-bottom: 28px;
    }

    .section-title {
        font-size: 1rem;
        padding-left: 8px;
    }

    .section-title::before {
        width: 2px;
        height: 12px;
    }

    /* 커뮤니티 */
    .community-item {
        padding: 12px 14px;
    }

    .community-item:hover {
        padding-left: 18px;
        box-shadow: inset 3px 0 0 #000;
    }

    .community-category {
        padding: 3px 8px;
        font-size: 0.625rem;
        margin-bottom: 8px;
    }

    .community-title {
        font-size: 0.75rem;
        margin-bottom: 8px;
    }

    .community-meta {
        font-size: 0.625rem;
        gap: 8px;
    }

    /* 빈 상태 */
    .empty-state {
        padding: 32px 12px;
    }

    .empty-state i {
        font-size: 2rem;
    }

    .empty-state p {
        font-size: 0.8125rem;
    }
}

/* ==================== 가격 비교 카드 스타일 ==================== */
.price-compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.price-compare-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
    cursor: pointer;
}

.price-compare-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.price-compare-image {
    width: 100%;
    height: 180px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.price-compare-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.price-compare-content {
    padding: 16px;
}

.price-compare-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 12px;
    line-height: 1.4;
    min-height: 40px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price-compare-prices {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.price-compare-prices .price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.price-compare-prices .price-row:last-child {
    margin-bottom: 0;
}

.price-compare-prices .source-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
}

.price-compare-prices .price {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.price-diff-badge {
    text-align: center;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.price-diff-badge.cheaper-coupang {
    background: #E63946;
}

.price-diff-badge.cheaper-naver {
    background: #03C75A;
}

.price-diff-badge.similar {
    background: #95a5a6;
}

/* 만두 핫딜 그리드 스타일 */
.mandu-hotdeal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.mandu-card {
    background: #fff;
    border: 2px solid #ff9800;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
    cursor: pointer;
}

.mandu-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.mandu-card:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .price-compare-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 12px;
    }

    .price-compare-image {
        height: 150px;
    }

    .price-compare-content {
        padding: 12px;
    }

    .price-compare-title {
        font-size: 13px;
        min-height: 36px;
    }

    .price-compare-prices .price {
        font-size: 14px;
    }

    .price-diff-badge {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* 만두 핫딜 모바일 최적화 */
    .mandu-hotdeal-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .mandu-card {
        max-width: 100%;
    }
}
