/**
 * Auction Profit Calculator Styles
 * 경매/공매 수익률 계산기 전용 스타일 (3탭)
 *
 * Tab1: 경매 수익률 (3 시나리오: 매도/월세/전세)
 * Tab2: 공매 수익률 (캠코 공매 조건 적용)
 * Tab3: 적정 입찰가 (역산)
 *
 * Prefix: apc-
 * @package Zipper
 */

/* ===== 2컬럼 레이아웃 (데스크탑) ===== */
.apc-main-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 20px;
    align-items: start;
}

.apc-input-col {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.apc-result-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ===== 공통 섹션 ===== */
.apc-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
    transition: box-shadow 0.2s ease;
}

.apc-section:hover {
    box-shadow: 0 2px 8px rgba(45, 42, 38, 0.1);
}

.apc-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #2d2a26;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.apc-section-title i {
    color: #d4af37;
    font-size: 15px;
}

/* ===== 탭 (3개 -> flex OK, Rule 25) ===== */
.apc-tabs {
    display: flex;
    gap: 4px;
    background: #f5f3f0;
    border-radius: 8px;
    padding: 3px;
}

.apc-tab {
    flex: 1;
    padding: 10px 6px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #9e9a96;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.apc-tab:hover {
    color: #5f5a56;
}

.apc-tab.active {
    background: #fff;
    color: #d4af37;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.15);
}

/* ===== 탭 콘텐츠 ===== */
.apc-tab-panel {
    display: none;
}

.apc-tab-panel.active {
    display: block;
}

/* Tab wrapper internal spacing (Rule 44) */
.apc-tab-panel .apc-section + .apc-section {
    margin-top: 14px;
}

.apc-tab-panel .apc-btn-group {
    margin-top: 14px;
}

/* ===== 입력 그룹 ===== */
.apc-input-group {
    margin-bottom: 12px;
    max-width: 100%;
    box-sizing: border-box;
}

.apc-input-group:last-child {
    margin-bottom: 0;
}

.apc-input-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #5f5a56;
    margin-bottom: 6px;
}

.apc-input-group .apc-sub-label {
    font-weight: 400;
    color: #9e9a96;
    margin-left: 4px;
}

.apc-amount-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px 12px;
    font-size: 15px;
    font-weight: 600;
    text-align: right;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    background: #faf9f7;
    color: #2d2a26;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.apc-amount-input:hover {
    border-color: #d4c67a;
}

.apc-amount-input:focus {
    outline: none;
    border-color: #d4af37;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.apc-amount-input::placeholder {
    font-weight: 400;
    color: #c4c0bc;
}

.apc-number-input {
    width: 80px;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 8px 10px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    background: #faf9f7;
    color: #2d2a26;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.apc-number-input:hover {
    border-color: #d4c67a;
}

.apc-number-input:focus {
    outline: none;
    border-color: #d4af37;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.apc-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px 12px;
    font-size: 13px;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    background: #faf9f7;
    color: #2d2a26;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%235f5a56' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.apc-select:hover {
    border-color: #d4c67a;
}

.apc-select:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

/* ===== 한글 금액 표시 ===== */
.apc-kr-display {
    font-size: 11px;
    color: #d4af37;
    margin-top: 4px;
    text-align: right;
    min-height: 16px;
}

.apc-help-text {
    font-size: 11px;
    color: #9e9a96;
    margin-top: 4px;
}

/* ===== 인라인 그룹 ===== */
.apc-inline-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.apc-inline-group .apc-unit {
    font-size: 12px;
    color: #5f5a56;
    white-space: nowrap;
}

/* ===== 입력 행 (2열) ===== */
.apc-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* ===== 체크박스 그룹 ===== */
.apc-checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.apc-checkbox-group:hover {
    border-color: #d4c67a;
}

.apc-checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #d4af37;
    cursor: pointer;
    flex-shrink: 0;
}

.apc-checkbox-group span {
    font-size: 13px;
    color: #2d2a26;
}

/* ===== 낙찰가율 표시 뱃지 ===== */
.apc-bid-rate-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #d4af37;
    background: #fdfbf5;
    border: 1px solid #e8dfc0;
    border-radius: 6px;
    margin-top: 6px;
}

/* ===== 공매 안내 박스 ===== */
.apc-info-box {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    background: #fdfbf5;
    border: 1px solid #e8dfc0;
    border-radius: 8px;
    font-size: 12px;
    color: #5f5a56;
    line-height: 1.5;
}

.apc-info-box i {
    font-size: 16px;
    color: #d4af37;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ===== 버튼 ===== */
.apc-btn-group {
    display: flex;
    gap: 8px;
}

.apc-btn-primary {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #d4af37, #c9a030);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.25);
}

.apc-btn-primary:hover {
    background: linear-gradient(135deg, #c9a030, #b8922a);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
}

.apc-btn-secondary {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #5f5a56;
    background: #f5f3f0;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.apc-btn-secondary:hover {
    background: #eae7e3;
}

/* ===== 결과 - 대기 영역 ===== */
.apc-waiting {
    text-align: center;
    padding: 40px 20px;
    color: #9e9a96;
}

.apc-waiting i {
    font-size: 32px;
    margin-bottom: 12px;
    display: block;
    color: #d4af37;
    opacity: 0.4;
}

.apc-waiting p {
    font-size: 13px;
    margin: 0;
}

/* ===== 결과 - 요약 카드 ===== */
.apc-result-summary {
    background: linear-gradient(135deg, #fdfbf5 0%, #faf6ec 100%);
    border: 2px solid #d4af37;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(212, 175, 55, 0.12);
}

.apc-summary-title {
    font-size: 12px;
    color: #7a756d;
    margin-bottom: 8px;
}

.apc-summary-main {
    font-size: 32px;
    font-weight: 700;
    color: #d4af37;
    margin-bottom: 4px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.apc-summary-sub {
    font-size: 13px;
    color: #5f5a56;
    margin-bottom: 16px;
}

.apc-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.apc-summary-card {
    text-align: center;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
}

.apc-summary-card-label {
    font-size: 11px;
    color: #7a756d;
    margin-bottom: 4px;
}

.apc-summary-card-value {
    font-size: 18px;
    font-weight: 700;
    color: #2d2a26;
}

.apc-summary-card-value.positive {
    color: #2e7d32;
}

.apc-summary-card-value.negative {
    color: #c62828;
}

/* ===== 3 시나리오 비교 카드 ===== */
.apc-scenario-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.apc-scenario-card {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: box-shadow 0.2s;
}

.apc-scenario-card:hover {
    box-shadow: 0 2px 8px rgba(45, 42, 38, 0.1);
}

.apc-scenario-card-title {
    font-size: 12px;
    font-weight: 600;
    color: #7a756d;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8e4dc;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.apc-scenario-card-title i {
    color: #d4af37;
}

.apc-scenario-card-highlight {
    font-size: 22px;
    font-weight: 700;
    color: #d4af37;
    margin: 8px 0;
}

.apc-scenario-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 12px;
}

.apc-scenario-card-label {
    color: #7a756d;
}

.apc-scenario-card-value {
    font-weight: 600;
    color: #2d2a26;
}

.apc-scenario-card.best {
    border-color: #d4af37;
    background: linear-gradient(135deg, #fdfbf5 0%, #faf6ec 100%);
    box-shadow: 0 2px 12px rgba(212, 175, 55, 0.12);
}

.apc-scenario-card.best .apc-scenario-card-title {
    color: #d4af37;
    border-bottom-color: rgba(212, 175, 55, 0.3);
}

/* ===== 비용 상세 테이블 ===== */
.apc-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.apc-detail-table th {
    padding: 8px 12px;
    background: #faf9f7;
    border-bottom: 1px solid #e8e4dc;
    font-weight: 600;
    color: #5f5a56;
    text-align: left;
}

.apc-detail-table th:last-child {
    text-align: right;
}

.apc-detail-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0ede8;
    color: #2d2a26;
}

.apc-detail-table td:last-child {
    text-align: right;
    font-weight: 600;
}

.apc-detail-table tbody tr:hover td {
    background: #faf9f7;
}

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

.apc-detail-table .apc-highlight-row {
    background: #fdfbf5;
    border: 1px solid #e8dfc0;
}

.apc-detail-table .apc-highlight-row td {
    color: #d4af37;
    font-weight: 700;
    font-size: 14px;
}

/* ===== 적정 입찰가 결과 카드 ===== */
.apc-bid-result-card {
    background: linear-gradient(135deg, #fdfbf5 0%, #faf6ec 100%);
    border: 2px solid #d4af37;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(212, 175, 55, 0.12);
}

.apc-bid-result-label {
    font-size: 13px;
    color: #7a756d;
    margin-bottom: 8px;
}

.apc-bid-result-main {
    font-size: 28px;
    font-weight: 700;
    color: #d4af37;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.apc-bid-result-sub {
    font-size: 14px;
    font-weight: 600;
    color: #5f5a56;
}

.apc-bid-result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.apc-bid-result-item {
    padding: 12px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
}

.apc-bid-result-item-label {
    font-size: 11px;
    color: #7a756d;
    margin-bottom: 4px;
}

.apc-bid-result-item-value {
    font-size: 16px;
    font-weight: 700;
    color: #2d2a26;
}

/* ===== 차트 섹션 ===== */
.apc-chart-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

.apc-chart-title {
    font-size: 14px;
    font-weight: 700;
    color: #2d2a26;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.apc-chart-title i {
    color: #d4af37;
}

.apc-chart-wrap {
    position: relative;
    width: 100%;
    height: 280px;
    margin: 0 auto;
}

.apc-chart-wrap canvas {
    max-height: 280px;
}

.apc-donut-wrap {
    position: relative;
    width: 100%;
    max-width: 280px;
    height: 280px;
    margin: 0 auto;
}

/* ===== 엑셀 다운로드 버튼 ===== */
.apc-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    background: #217346;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.apc-download-btn:hover {
    background: #1a5c38;
}

/* ===== 스케줄 헤더 ===== */
.apc-schedule-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.apc-schedule-header .apc-section-title {
    margin-bottom: 0;
}

/* ===== 테이블 래퍼 ===== */
.apc-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 400px;
    max-width: 100%;
}

/* ===== 경고 박스 ===== */
.apc-warning-box {
    display: flex;
    align-items: start;
    gap: 10px;
    padding: 12px 14px;
    background: #fff3e0;
    border: 1px solid #ffb74d;
    border-radius: 8px;
}

.apc-warning-box i {
    font-size: 16px;
    color: #e67e22;
    flex-shrink: 0;
    margin-top: 1px;
}

.apc-warning-box span {
    font-size: 12px;
    color: #e65100;
    line-height: 1.5;
    font-weight: 500;
}

/* ===== 면책 조항 ===== */
.apc-disclaimer {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    font-size: 11px;
    color: #9e9a96;
    line-height: 1.5;
}

.apc-disclaimer i {
    color: #d4af37;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ===== 유틸리티 ===== */
.apc-hidden {
    display: none !important;
}

/* ===== 모션 감소 접근성 ===== */
@media (prefers-reduced-motion: reduce) {
    .apc-section,
    .apc-amount-input,
    .apc-select,
    .apc-btn-primary,
    .apc-tab,
    .apc-checkbox-group {
        transition: none !important;
    }
    .apc-section:hover,
    .apc-btn-primary:hover {
        transform: none !important;
    }
}

/* ===== 반응형 (900px) ===== */
@media (max-width: 900px) {
    .apc-main-layout {
        grid-template-columns: 1fr;
    }

    .apc-input-col {
        position: static;
        width: 100%;
    }

    .apc-result-col {
        width: 100%;
    }

    .apc-input-group input:not([type="radio"]):not([type="checkbox"]),
    .apc-input-group select {
        width: 100% !important;
        max-width: 100% !important;
    }

    .apc-summary-main {
        font-size: 26px;
    }

    .apc-summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .apc-scenario-cards {
        grid-template-columns: 1fr;
    }

    .apc-detail-table {
        font-size: 12px;
    }

    .apc-detail-table th,
    .apc-detail-table td {
        padding: 10px 10px;
    }

    .apc-input-row {
        grid-template-columns: 1fr;
    }

    .apc-bid-result-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== 반응형 (480px) ===== */
@media (max-width: 480px) {
    .apc-section {
        padding: 12px;
    }

    .apc-result-summary,
    .apc-bid-result-card {
        padding: 16px;
    }

    .apc-summary-main {
        font-size: 22px;
    }

    .apc-summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .apc-summary-card-value {
        font-size: 16px;
    }

    .apc-tabs {
        flex-direction: column;
    }

    .apc-tab {
        padding: 8px 6px;
        font-size: 12px;
    }

    .apc-donut-wrap {
        max-width: 200px;
        height: 200px;
    }

    .apc-detail-table {
        font-size: 11px;
    }

    .apc-detail-table th,
    .apc-detail-table td {
        padding: 8px 8px;
    }

    .apc-chart-wrap {
        height: 250px;
    }

    .apc-chart-wrap canvas {
        max-height: 250px;
    }

    .apc-scenario-card-highlight {
        font-size: 18px;
    }

    .apc-bid-result-main {
        font-size: 22px;
    }
}

/* Excel button guard */
.tool-btn-excel {
  background: #59ab79;
  border-color: #59ab79;
}

.tool-btn-excel:hover,
.tool-btn-excel:focus-visible {
  background: #4f9f70;
  border-color: #4f9f70;
}

