/**
 * components/card.css — 카드 컴포넌트 단일 소스
 * .card-header 는 dashboard.css 기준 22px 로 통일.
 * ui.css(20px) / analysis_card.css 중복 정의 모두 이 파일로 귀결.
 */

/* ── 기본 카드 ────────────────────────────────── */
.card {
    background: var(--white);
    padding: 20px;
    margin-bottom: 0;
}

/* ── 카드 헤더 (모든 alias 통합) ─────────────── */
.card-header,
.weather-header,
.weekly-header,
.insight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--brown-dark);
    font-family: var(--font-family);
    padding-bottom: 16px;
    margin-bottom: 18px;
    border-bottom: 2px solid #f0f1f5;
}

.card-header i,
.weather-header i,
.weekly-header i,
.insight-header i {
    font-size: 28px;
}

/* ── 헤더 내부 그룹 ───────────────────────────── */
.header-title-group {
    display: flex;
    align-items: center;
}

.header-title-group i {
    margin-right: 10px;
}

.header-more-btn {
    color: #4e342e;
    cursor: pointer;
    display: flex;
    align-items: center;
    margin-right: 11px;
}

.header-more-btn:hover {
    color: var(--primary-color);
}

/* ── 카드 위치/시각 정보 줄 ───────────────────── */
.card-location-info {
    font-size: 17px;
    color: #666;
    display: flex;
    align-items: center;
}

.card-location-info i {
    color: #e9e8e8;
    margin-right: 4px;
    font-size: 16px;
}

.card-timestamp-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 17px;
    color: #666;
    margin-top: -8px;
    margin-bottom: 20px;
    padding: 0 4px;
    font-weight: 500;
}

/* ── 카드 조언 영역 ───────────────────────────── */
.card-advice {
    display: flex;
    flex-direction: row;
    gap: 14px;
    background: #faf7f4;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    align-items: flex-start;
}

.card-advice-text {
    flex: 1;
    font-size: 15px;
    color: #444;
    line-height: 1.6;
}

/* ── 정보 버튼 (Info Button) ───────────────────── */
.info-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: #ccc;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
}

.info-btn:hover {
    color: #795548;
    transform: scale(1.1);
}

/* ── 정보 모달 전용 스타일 ──────────────────────── */
.info-modal-content {
    max-width: 500px !important;
    height: auto !important;
    max-height: 90vh !important;
    border-radius: 16px !important;
    padding: 0 !important;
    background: #1a1d21 !important;
    /* 헤더와 본문 여백 별도 관리 */
    overflow: hidden;
}

.info-modal-content .modal-header {
    background: #212529;
    padding: 16px 20px;
    margin-bottom: 0;
    border-bottom: none;
}

.info-modal-content .modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.info-modal-content .close-btn {
    color: #ffffff80;
}

.info-modal-content .modal-body {
    padding: 0;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #1a1d21;
}

.info-table th {
    background-color: #2c3036;
    color: #adb5bd;
    font-weight: 500;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #343a40;
}

.info-table td {
    padding: 16px;
    border-bottom: 1px solid #2c3036;
    line-height: 1.5;
    color: #dee2e6;
    vertical-align: top;
}

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

.info-table td:first-child {
    white-space: nowrap;
    /* 글자 줄바꿈 방지 (가로 출력 보장) */
    font-weight: 700;
    width: 60px;
}

.info-table .grade-optimal {
    color: #63e6be;
}

.info-table .grade-good {
    color: #b2f2bb;
}

.info-table .grade-normal {
    color: #ffec99;
}

.info-table .grade-caution {
    color: #ffc078;
}

.info-table .grade-weak {
    color: #ffa8a8;
}

.info-table .grade-info {
    color: #a1d6ff;
}

.info-table .score-range {
    font-weight: 600;
    color: #f8f9fa;
    white-space: nowrap;
    min-width: 90px;
}

/* 소형 모바일 (380px 이하) */
@media (max-width: 380px) {
    .card {
        padding: 20px;
    }

    .info-modal-content {
        width: 95%;
        margin: 0 auto;
    }
}