/* 카드 스타일 */
.card-style { background: #fff; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); padding: 20px; }

/* 상단 카드 컨테이너 */
.top-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 20px; padding: 0px 0px 0px 0px; }

.total-card:last-child { grid-column: span 1; }

.total-card { padding: 10px 20px 10px 20px; text-align: left; background-color: var(--card-background); border-radius: 10px; }

.top-cards h2 { font-size: 16px; color: rgba(255, 255, 255, 0.8); padding: 10px 0px 10px 0px; margin: 0px; }

.total-value { font-size: 24px; font-weight: bold; color: #dd8484; margin: 10px 0px 15px 0px; }

.total-description { margin-top: 14px; font-size: 12px; color: rgba(255, 255, 255, 0.5); display: flex; align-items: center; gap: 6px; }

.description-icon { width: 16px; height: 16px; object-fit: contain; }

/* 패키지 테이블 */
.package-table-container { overflow-x: auto; margin: 0 20px; padding: 20px 20px 30px 20px; border-radius: 10px; background-color: var(--card-background); }

.package-table { width: 100%; border-collapse: collapse; text-align: left; }

.package-table th,
.package-table td { font-size: 13px; padding: 10px; color: rgb(255, 255, 255, 0.4); height: 30px; }

.package-table tr { min-height: 30px; }

/* 체크박스 스타일 */
.check-column { width: 30px; }

img[src*="check-off.png"] { width: 16px !important; height: 16px !important; object-fit: contain !important; opacity: 0.6; cursor: pointer; }

img[src*="check-on.png"] { width: 20px !important; height: 20px !important; object-fit: contain !important; transform: translateX(1px) translateY(-0.5px); cursor: pointer; }

/* 이미지 스타일 */
.img-column { width: 60px; }

.package-img { width: 60px; height: 60px; object-fit: contain; border-radius: 8px; }

/* 드롭다운 스타일 */
.count-select,
.discount-select { font-size: 12px; background-color: rgb(0, 0, 0, 0.1); color: rgb(255, 255, 255, 0.4); border: none; border-radius: 4px; cursor: pointer; width: auto; min-width: fit-content; padding: 8px 4px !important; }

/* 옵션 스타일링 */
select option { background-color: var(--card-background); color: rgb(255, 255, 255, 0.8); }

/* 선택된 옵션 스타일링 */
select option:checked { background-color: #4d3e3e; }

/* 호버 상태 스타일링 */
select option:hover { background-color: #4d3e3e; }

/* Firefox에서 옵션 배경색 강제 적용 */
select:-moz-focusring { color: transparent; text-shadow: 0 0 0 rgb(255, 255, 255, 0.8); }

/* 테이블 헤더 스타일 */
.package-table th { padding: 10px 8px 15px 8px; border-bottom: 2px solid rgba(255, 255, 255, 0.2); color: rgba(255, 255, 255, 0.6); font-weight: 800; }

/* 재화 값 중앙 정렬 */
.resource-value { text-align: center !important; }

/* 가격 텍스트 스타일 */
.price-value { color: rgb(255, 255, 255, 0.4); width: 100px;}

/* 테이블 행 구분선 */
.package-table tr:not(:first-child) td { border-top: 1px solid rgb(255, 255, 255, 0.08); }

.package-table tr:first-child td { border-top: 1px solid rgb(255, 255, 255, 0.5); }

.package-table tr:last-child td { border-bottom: 1px solid rgb(255, 255, 255, 0.2); }

/* 선택된 행의 스타일 */
.package-table tr.selected td { color: rgba(255, 255, 255, 0.9) !important; }

.package-table tr.selected .value-column { color: #dd8484 !important; }

.package-table tr.selected .price-value { color: rgba(255, 255, 255, 0.9) !important; font-weight: bold; }

/* 기타 재화 그룹 스타일 */
.total-value-group { font-size: 18px; color: #dd8484; margin-top: 10px; line-height: 1.6; }

.total-value-group div { margin: 5px 0; }

/* 리소스 그리드 스타일 */
.resources-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin: 15px 0px 15px 0px; }

.resource-item { display: flex; align-items: center; gap: 8px; color: #dd8484; font-size: 16px; }

.resource-item img { width: 24px; height: 24px; object-fit: contain; }

/* 기대값 요약 영역 */
.expectation-row {
    margin: 0 0px 20px 0px;
    background-color: var(--card-background);
    border-radius: 10px;
    border-bottom: 3px solid var(--border-red);
}

.expectation-main-title {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    padding: 0 0 10px 0;
    margin: 0 0 4px 0;
}

.expectation-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.expectation-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.expectation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.expectation-title {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.expectation-value {
    font-size: 20px;
    font-weight: bold;
    color: #dd8484;
}

.expectation-median {
    margin-left: 4px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.expectation-separator {
    margin: 0 6px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: normal;
}

.expectation-currency {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.expectation-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.5);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    cursor: help;
}

@media (max-width: 768px) {
    .top-cards {
        grid-template-columns: 1fr;
        gap: 12px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .total-card:last-child {
        grid-column: span 1;
    }

    .expectation-grid {
        grid-template-columns: 1fr;
    }

    .expectation-row {
        margin-left: 0px;
        margin-right: 0px;
    }
}

/* 보유 재화 입력 필드 */
.resource-input { 
    width: 100%;
    max-width: 100px;
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    text-align: right;
    box-sizing: border-box;
}

.resource-input::-webkit-outer-spin-button,
.resource-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.resource-input[type=number] {
    -moz-appearance: textfield;
}

.resource-unit {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

/* 테이블 헤더 아이콘 */
.resource-icon { width: 24px; height: 24px; object-fit: contain; display: block; margin: 0 auto; }

/* 테이블 열 너비 조정 */
.package-table th:nth-child(3),
.package-table td:nth-child(3) { width: 150px; max-width: 150px; }

.package-table th:nth-child(5),
.package-table td:nth-child(5),
.package-table th:nth-child(6),
.package-table td:nth-child(6),
.package-table th:nth-child(7),
.package-table td:nth-child(7),
.package-table th:nth-child(8),
.package-table td:nth-child(8),
.package-table th:nth-child(9),
.package-table td:nth-child(9)
{ width: 80px; max-width: 80px; }

.package-table th:nth-child(10),
.package-table td:nth-child(10) { width: 60px; min-width: 60px; white-space: nowrap; padding-left: 4px; padding-right: 4px; }

.package-table th:nth-child(11),
.package-table td:nth-child(11) { width: 1%; white-space: nowrap; padding-left: 4px; padding-right: 4px; }

/* 메모 열 스타일 */
.note-column { font-size: 11px !important; color: rgba(255, 255, 255, 0.4) !important; width:71px}

/* 모바일 재화 표시 스타일 */
.resources-mobile { display: none; }

.resource-mobile-item { display: inline-flex; align-items: center; margin-right: 12px; color: #dd8484; }

.resource-mobile-item:last-child { margin-right: 0; }

.resource-mobile-icon { width: 16px; height: 16px; margin-right: 4px; }

/* 모바일 가격 스타일 */
.mobile-price { font-size: 16px; font-weight: bold; padding: 8px 0; }

/* 모바일 대응 */
@media (max-width: 1200px) { 
    .main-wrapper { box-sizing: border-box; }
    
    .navigation-path, .header-container, .top-cards { padding-left: 0px; padding-right: 0px; }

    .top-cards { grid-template-columns: repeat(2, 1fr); }

    /* 모바일/태블릿에서 특정 카드들은 한 줄 전체를 사용 */
    .top-cards .total-card:nth-child(4),
    .top-cards .total-card:nth-child(5),
    .top-cards .total-card:last-child { grid-column: span 2; }

    .package-table-container { background-color: transparent; padding: 0; margin: 0; }

    .package-table { display: block; padding-top: 8px; }

    .package-table thead { display: none; }

    .package-table tbody { display: block; }

    /* 모바일 카드 레이아웃 개선 */
    .package-table tr { 
        display: grid; 
        grid-template-areas:
            "check img info info"
            "check img price price"
            "resources resources resources resources"
            "count count discount discount"; 
        grid-template-columns: 32px 56px 1fr 1fr; 
        grid-template-rows: auto auto auto auto;
        gap: 6px 12px; 
        padding: 14px 16px; 
        margin: 0 0 10px 0; 
        background: var(--card-background);
        border-radius: 8px;
    }

    .package-table td { padding: 0px; border: none !important; }

    /* 체크박스 영역 */
    .check-column { 
        grid-area: check; 
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 이미지 영역 */
    .img-column { 
        grid-area: img; 
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .package-img { 
        width: 48px; 
        height: 48px; 
        object-fit: contain;
        border-radius: 8px;
    }

    /* 이름 영역 */
    .name-column { 
        grid-area: info; 
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        gap: 2px;
        font-size: 14px; 
        font-weight: 600;
        color: rgba(255, 255, 255, 0.9) !important;
        line-height: 1.3;
    }

    /* 가격 영역 */
    .mobile-price { 
        grid-area: price !important;
        display: flex !important;
        align-items: center;
        gap: 8px;
        padding: 0 !important;
        border: none !important;
        height: auto !important;
        width: auto !important;
    }

    /* 수량/할인 컨트롤 영역 - 가로 배치 */
    .count-column { 
        grid-area: count; 
        display: flex !important;
        align-items: center;
        gap: 8px;
    }

    .count-column::before {
        content: '수량';
        font-size: 11px;
        color: rgba(255, 255, 255, 0.5);
        white-space: nowrap;
    }

    .discount-column { 
        grid-area: discount;
        display: flex !important;
        align-items: center;
        gap: 8px;
    }

    .discount-column::before {
        content: '할인';
        font-size: 11px;
        color: rgba(255, 255, 255, 0.5);
        white-space: nowrap;
    }

    /* 리소스 영역 - resources-mobile 클래스 사용 */
    .resources-mobile { 
        grid-area: resources; 
        display: flex !important;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
    }

    /* 모바일 가격 스타일 */
    .mobile-price .price-main {
        font-size: 16px;
        font-weight: 700;
        color: #dd8484;
    }

    .mobile-price .efficiency-mobile {
        font-size: 11px;
        color: rgba(255, 255, 255, 0.4);
        margin-left: 0;
    }

    .resource-mobile-item {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 4px 8px;
        background: rgba(221, 132, 132, 0.15);
        border-radius: 6px;
        font-size: 12px;
        font-weight: 600;
        color: #dd8484;
        margin: 0;
    }

    .resource-mobile-icon {
        width: 14px;
        height: 14px;
        margin: 0;
    }

    /* 수량/할인 드롭다운 */
    .count-select,
    .discount-select { 
        flex: 1;
        min-width: 0;
        font-size: 12px;
        padding: 6px 8px !important;
        background: rgba(0, 0, 0, 0.2);
        border: none;
        border-radius: 4px;
        color: rgba(255, 255, 255, 0.6);
    }


    .total-value-group { font-size: 16px; }

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

    .resource-item { font-size: 14px; }

    .resource-item img { width: 20px; height: 20px; }


    /* 선택된 행 스타일 */
    .package-table tr.selected { 
        background: #3d2e2e;
    }

    .package-table tr.selected .name-column {
        color: #fff !important;
    }

    .package-table tr.selected .mobile-price .price-main {
        color: #ff9999;
    }

    .resource-value { text-align: left !important; }

    .package-table td:nth-child(10),
    .package-table td:nth-child(11) { width: auto; white-space: normal; }

    /* 데스크톱 전용 재화 열 숨기기 */
    .value-column { 
        display: none !important; 
    }

    /* 메모 열 숨기기 */
    .note-column { 
        display: none !important; 
    }

    /* 데스크톱 전용 재화 아이콘 숨기기 */
    .resource-with-icon { display: none; }

    .efficiency-pc { display: none; }

    .efficiency-mobile { display: inline; }

    .price-main { display: inline; margin-bottom: 0; }
} 

/* 테이블 내 자원 표시 스타일 */
.resource-with-icon { display: flex; align-items: center; justify-content: center; gap: 4px; }

.resource-table-icon { width: 16px; height: 16px; object-fit: contain; }

/* 선택된 행의 스타일 */
.package-table tr.selected .resource-with-icon { color: #dd8484; }

/* 가격 표시 스타일 */
.price-main { font-weight: bold; margin-bottom: 4px; }

.efficiency-pc { display: block; font-size: 12px; color: rgba(255, 255, 255, 0.4); font-weight: normal; margin-top: 4px; }

.efficiency-mobile { display: none; font-size: 12px; color: rgba(255, 255, 255, 0.4); font-weight: normal; }

/* 선택된 행의 스타일 */
.package-table tr.selected .price-main { color: rgba(255, 255, 255, 0.9); }

.package-table tr.selected .efficiency-pc,
.package-table tr.selected .efficiency-mobile { color: rgba(255, 255, 255, 0.6); }

/* 카드 헤더 스타일 */
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }

.card-header h2 { font-size: 16px; color: rgba(255, 255, 255, 0.8); padding: 10px 0px 10px 0px; margin: 0px; }

/* 체크박스 컨테이너 스타일 */
.payback-checkbox,
.convert-checkbox { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: rgba(255, 255, 255, 0.6); font-size: 14px; }

.payback-checkbox input[type="checkbox"],
.convert-checkbox input[type="checkbox"] { display: none; }

.checkbox-img { width: 20px; height: 20px; min-width: 24px; min-height: 24px; object-fit: none; opacity: 0.6; padding: 2.5px; box-sizing: border-box; }


.convert-icon { width: 16px; height: 16px; object-fit: contain; }

/* ALL 변환 컨트롤 스타일 */
.all-convert-controls { display: flex; gap: 12px; }

.convert-checkbox { padding: 2px; }

/* 모바일 대응 */
@media (max-width: 1200px) { .card-header { flex-direction: column; align-items: flex-start; gap: 8px; }

    .all-convert-controls { width: 100%; justify-content: flex-end; }
} 

/* 탭 스타일 */
.tab-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255, 255, 255, 0.2); }

.filter-dropdown { position: relative; display: inline-block; }

.filter-button { display: flex; align-items: center; gap: 8px; padding: 8px 16px; margin-right: 10px; background: none; border: none; border-radius: 8px; color: rgb(255, 255, 255, 0.6); cursor: pointer; }

.filter-button img { width: 16px; height: 16px; }

.dropdown-content { display: none; position: absolute; right: 0; background: rgba(0, 0, 0, 0.8); border-radius: 4px; padding: 8px; min-width: 120px; z-index: 1; }

.dropdown-content.show { display: block; }

.dropdown-item { padding: 8px 12px; cursor: pointer; color: white; border-radius: 4px; }

.dropdown-item:hover { background: rgba(255, 255, 255, 0.1); }

.dropdown-item.active { background: rgba(255, 255, 255, 0.2); }

.table-tabs { margin: 0 0px; padding: 0; background-color: var(--card-background); border-radius: 10px; }

.tab-buttons { display: flex; padding: 0 20px; }

.tab-button { padding: 12px 20px; background: none; border: none; color: rgba(255, 255, 255, 0.6); font-size: 14px; cursor: pointer; position: relative; transition: all 0.3s ease; }

.tab-button:hover { color: rgba(255, 255, 255, 0.8); }

.tab-button.active { color: #dd8484; font-weight: bold; }

.tab-button.active::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background-color: #dd8484; }

.tab-content { display: none; padding: 20px; }

.tab-content.active { display: block; }

/* 테이블 스타일 */
.table-responsive { overflow-x: auto; margin: 0; padding: 0; }

.defense-table { width: 100%; border-collapse: collapse; text-align: left; }

.defense-table th,
.defense-table td { font-size: 13px; padding: 10px; color: rgb(255, 255, 255, 0.4); height: 30px; }

.defense-table tr { min-height: 30px; }

.defense-table th { padding: 10px 8px 15px 8px; border-bottom: 2px solid rgba(255, 255, 255, 0.2); color: rgba(255, 255, 255, 0.6); font-weight: 800; }

.defense-table td { vertical-align: middle; padding: 8px; border-top: 1px solid rgb(255, 255, 255, 0.2); }

.defense-table tr:first-child td { border-top: 1px solid rgb(255, 255, 255, 0.5); }

.defense-table tr:last-child td { border-bottom: 1px solid rgb(255, 255, 255, 0.2); }

.check-column { width: 30px; }

.img-column img { height: 36px; border-radius: 25px; object-fit: contain; }

.resource-icon { width: 24px !important; height: 24px !important; max-width: 24px !important; max-height: 24px !important; object-fit: contain !important; }


/* 모바일 대응 */
@media (max-width: 1200px) { .table-tabs { margin: 0; background-color: transparent; }

    .tab-buttons { padding: 0; margin-bottom: 10px; }

    .tab-button { padding: 10px 15px; font-size: 13px; }

    .tab-content { padding: 0; }

    .defense-table { display: block; padding-top: 8px; }

    .defense-table thead { display: none; }

    .defense-table tbody { display: block; }

    .defense-table tr { display: grid; grid-template-areas:
    "check img name name"
    "price price amount discount"; grid-template-columns: 60px 60px 1fr auto; gap: 8px; padding: 12px; margin: 0 0 8px 0px; background: rgba(221, 132, 132, 0.1); border-radius: 8px; }

    .defense-table td { padding: 0px; border: none !important; }
} 