/**
 * Forex Profit Calculator Styles
 * 환테크 수익 계산기 전용 스타일
 * HTML 구조: tool-layout-split > tool-input-panel + tool-result-panel
 *
 * @package Zipper
 */

/* ===== 레이아웃 오버라이드 ===== */
.tool-section:has(.fpc-input-section) .tool-layout-split {
    grid-template-columns: 280px 1fr;
}

@media (max-width: 900px) {
    .tool-section:has(.fpc-input-section) .tool-layout-split {
        grid-template-columns: 1fr;
    }
}

/* ===== 입력 섹션 ===== */
.fpc-input-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 100%;
    overflow: hidden;
}

.fpc-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 100%;
}

.fpc-input-group label {
    font-size: 13px;
    font-weight: 600;
    color: #5f5a56;
}

.fpc-input-group input,
.fpc-input-group select {
    padding: 11px 12px;
    font-size: 15px;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    background: #faf9f7;
    color: #2d2a26;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

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

.fpc-input-group input::placeholder {
    color: #a09a94;
}

/* 통화 선택 라디오 */
.fpc-currency-options {
    display: flex;
    gap: 8px;
    background: #f5f3f0;
    border-radius: 8px;
    padding: 4px;
}

.fpc-currency-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    font-weight: 600;
    color: #7a756d;
}

.fpc-currency-option:hover {
    color: #2d2a26;
    background: rgba(255, 255, 255, 0.5);
}

.fpc-currency-option input[type="radio"] {
    width: 14px;
    height: 14px;
    accent-color: #d4af37;
    cursor: pointer;
}

.fpc-currency-option.active {
    color: #fff;
    background: #d4af37;
    box-shadow: 0 2px 4px rgba(212, 175, 55, 0.3);
}

/* 계산 버튼 */
.fpc-calc-btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}

.fpc-calc-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.35);
}

.fpc-calc-btn:active {
    transform: translateY(0);
}

/* 초기화 버튼 */
.fpc-action-btns {
    margin-top: 16px;
    max-width: 100%;
}

.fpc-reset-btn {
    width: 100%;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #7a756d;
    background: #fff;
    border: 1px solid #e8e4dc;
}

.fpc-reset-btn:hover {
    border-color: #d4af37;
    color: #d4af37;
    background: rgba(212, 175, 55, 0.05);
}

/* 도움말 텍스트 */
.fpc-help-text {
    font-size: 11px;
    color: #a09a94;
    margin: 0;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.fpc-help-text i {
    flex-shrink: 0;
    margin-top: 1px;
}

/* 금액 읽기 표시 */
.fpc-amount-display {
    font-size: 12px;
    color: #d4af37;
    font-weight: 500;
    margin-top: 4px;
    min-height: 18px;
}

/* 숨김 */
.fpc-hidden {
    display: none !important;
}

/* ===== 입력 패널 하단 가이드 ===== */
.fpc-input-guide {
    margin-top: 16px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    padding: 14px;
}

.fpc-input-guide .guide-title {
    font-size: 13px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fpc-input-guide .guide-title i {
    color: #d4af37;
}

.fpc-input-guide ul {
    margin: 0;
    padding-left: 18px;
}

.fpc-input-guide li {
    font-size: 12px;
    color: #5f5a56;
    margin-bottom: 4px;
    line-height: 1.5;
}

/* ===== 메인 결과 (순수익) ===== */
.fpc-main-result {
    position: relative;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(184, 134, 11, 0.05) 100%);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    margin-bottom: 16px;
}

.fpc-main-result.profit {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.12) 0%, rgba(39, 174, 96, 0.05) 100%);
    border-color: rgba(39, 174, 96, 0.35);
}

.fpc-main-result.loss {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.12) 0%, rgba(231, 76, 60, 0.05) 100%);
    border-color: rgba(231, 76, 60, 0.35);
}

.fpc-main-label {
    font-size: 14px;
    color: #7a756d;
    margin-bottom: 8px;
}

.fpc-main-value {
    font-size: 48px;
    font-weight: 700;
    color: #d4af37;
    line-height: 1;
    margin-bottom: 4px;
}

.fpc-main-result.profit .fpc-main-value {
    color: #27ae60;
}

.fpc-main-result.loss .fpc-main-value {
    color: #e74c3c;
}

.fpc-main-value .unit {
    font-size: 22px;
    font-weight: 600;
    color: #b8860b;
    margin-left: 4px;
}

.fpc-main-result.profit .fpc-main-value .unit {
    color: #229954;
}

.fpc-main-result.loss .fpc-main-value .unit {
    color: #c0392b;
}

.fpc-rate-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    color: #b8860b;
    background: rgba(212, 175, 55, 0.15);
    margin-top: 8px;
}

.fpc-main-result.profit .fpc-rate-badge {
    color: #27ae60;
    background: rgba(39, 174, 96, 0.15);
}

.fpc-main-result.loss .fpc-rate-badge {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.15);
}

/* 복사 버튼 */
.fpc-copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(184, 134, 11, 0.2);
    color: #b8860b;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.fpc-copy-btn:hover {
    background: rgba(184, 134, 11, 0.3);
}

.fpc-copy-btn.copied {
    background: #27ae60;
    color: #fff;
}

/* ===== 수익률 게이지 ===== */
.fpc-gauge-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    text-align: center;
}

.fpc-gauge-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.fpc-gauge-title i {
    color: #d4af37;
}

/* 게이지 래퍼 */
.fpc-gauge-wrapper {
    position: relative;
    width: 200px;
    height: 100px;
    margin: 0 auto 12px;
}

/* 반원형 트랙 (그라데이션 배경) */
.fpc-gauge-track {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: conic-gradient(
        from 180deg,
        #e74c3c 0deg,
        #f39c12 45deg,
        #f1c40f 90deg,
        #2ecc71 135deg,
        #27ae60 180deg,
        transparent 180deg
    );
    clip-path: polygon(0 0, 100% 0, 100% 50%, 0 50%);
}

/* 트랙 내부 원 (중앙 구멍) */
.fpc-gauge-track::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    width: 160px;
    height: 160px;
    background: #fff;
    border-radius: 50%;
}

/* 포인터 (바늘) */
.fpc-gauge-pointer {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 6px;
    height: 70px;
    background: linear-gradient(to top, #2d2a26 0%, #5f5a56 100%);
    border-radius: 3px;
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(-90deg);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 포인터 중심점 */
.fpc-gauge-pointer::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: #2d2a26;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* 중앙 값 표시 영역 */
.fpc-gauge-center {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 1;
}

.fpc-gauge-value {
    font-size: 28px;
    font-weight: 700;
    color: #2d2a26;
    line-height: 1;
    transition: color 0.3s ease;
}

.fpc-gauge-value.profit {
    color: #27ae60;
}

.fpc-gauge-value.loss {
    color: #e74c3c;
}

.fpc-gauge-label-center {
    font-size: 11px;
    color: #a09a94;
    margin-top: 2px;
}

/* 라벨 (하단) */
.fpc-gauge-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 600;
}

.fpc-gauge-labels .loss {
    color: #e74c3c;
}

.fpc-gauge-labels .neutral {
    color: #7a756d;
}

.fpc-gauge-labels .profit {
    color: #27ae60;
}

/* 결과 카드 래퍼 (스크롤 타겟) */
.fpc-results-card {
    scroll-margin-top: 20px;
}

/* ===== 상세 정보 카드 ===== */
.fpc-detail-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.fpc-detail-card {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.2s;
}

.fpc-detail-card:hover {
    border-color: #d4af37;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.12);
}

.fpc-detail-label {
    font-size: 13px;
    font-weight: 600;
    color: #5f5a56;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.fpc-detail-label i {
    color: #d4af37;
}

.fpc-detail-value {
    font-size: 24px;
    font-weight: 700;
    color: #2d2a26;
}

.fpc-detail-value .unit {
    font-size: 14px;
    font-weight: 500;
    color: #7a756d;
}

.fpc-detail-card.highlight {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(212, 175, 55, 0.02) 100%);
    border-color: rgba(212, 175, 55, 0.35);
}

.fpc-detail-card.highlight .fpc-detail-label {
    color: #d4af37;
}

.fpc-detail-card.highlight .fpc-detail-label i {
    color: #d4af37;
}

.fpc-detail-card.highlight .fpc-detail-value {
    color: #d4af37;
}

/* ===== 환율 시뮬레이션 테이블 ===== */
.fpc-simulation-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

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

.fpc-simulation-title i {
    color: #d4af37;
}

.fpc-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.fpc-simulation-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.fpc-simulation-table th,
.fpc-simulation-table td {
    padding: 10px 8px;
    text-align: right;
    border-bottom: 1px solid #f0ede8;
}

.fpc-simulation-table th {
    background: #faf9f7;
    font-weight: 600;
    color: #5f5a56;
    font-size: 12px;
    position: sticky;
    top: 0;
}

.fpc-simulation-table th:first-child,
.fpc-simulation-table td:first-child {
    text-align: center;
}

.fpc-simulation-table td {
    color: #2d2a26;
}

.fpc-simulation-table tr.current {
    background: rgba(212, 175, 55, 0.08);
    font-weight: 600;
}

.fpc-simulation-table tr.current td {
    color: #d4af37;
}

.fpc-simulation-table tr:hover:not(.current) {
    background: #faf9f7;
}

.fpc-simulation-table .profit {
    color: #27ae60;
    font-weight: 600;
}

.fpc-simulation-table .loss {
    color: #e74c3c;
    font-weight: 600;
}

/* ===== 목표 수익 역계산 ===== */
.fpc-target-section {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.08) 0%, rgba(52, 152, 219, 0.02) 100%);
    border: 1px solid rgba(52, 152, 219, 0.25);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.fpc-target-title {
    font-size: 13px;
    font-weight: 600;
    color: #3498db;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fpc-target-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.fpc-target-input-group input {
    flex: 1;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 6px;
    background: #fff;
    color: #2d2a26;
}

.fpc-target-input-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.fpc-target-input-group button {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: #3498db;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.fpc-target-input-group button:hover {
    background: #2980b9;
}

.fpc-target-result {
    text-align: center;
    padding: 14px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid rgba(52, 152, 219, 0.2);
}

.fpc-target-result-label {
    font-size: 12px;
    color: #7a756d;
    margin-bottom: 4px;
}

.fpc-target-result-value {
    font-size: 22px;
    font-weight: 700;
    color: #3498db;
}

.fpc-target-result-value .unit {
    font-size: 14px;
    font-weight: 500;
    color: #7a756d;
}

/* ===== 복리 계산 ===== */
.fpc-compound-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

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

.fpc-compound-title i {
    color: #d4af37;
}

.fpc-compound-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.fpc-compound-input-group label {
    font-size: 13px;
    font-weight: 600;
    color: #5f5a56;
    flex-shrink: 0;
}

.fpc-compound-input-group select {
    flex: 1;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    background: #faf9f7;
    color: #2d2a26;
}

.fpc-compound-input-group select:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.1);
    background: #fff;
}

.fpc-compound-result {
    text-align: center;
    padding: 14px;
    background: rgba(39, 174, 96, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(39, 174, 96, 0.25);
}

.fpc-compound-result-label {
    font-size: 12px;
    color: #7a756d;
    margin-bottom: 4px;
}

.fpc-compound-result-value {
    font-size: 22px;
    font-weight: 700;
    color: #27ae60;
}

.fpc-compound-result-value .unit {
    font-size: 14px;
    font-weight: 500;
    color: #229954;
}

/* ===== 안내문 ===== */
.fpc-notice {
    text-align: center;
    padding: 12px;
    background: #faf9f7;
    border-radius: 8px;
}

.fpc-notice p {
    font-size: 12px;
    color: #a09a94;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.fpc-notice i {
    color: #d4af37;
}

/* ===== 반응형 - 태블릿 ===== */
@media (max-width: 900px) {
    .fpc-detail-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* ===== 반응형 - 모바일 ===== */
@media (max-width: 768px) {
    .fpc-main-result {
        padding: 20px 16px;
    }

    .fpc-main-value {
        font-size: 40px;
    }

    .fpc-main-value .unit {
        font-size: 18px;
    }

    .fpc-detail-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .fpc-detail-card {
        padding: 14px 10px;
    }

    .fpc-detail-value {
        font-size: 20px;
    }

    .fpc-gauge-wrapper {
        width: 180px;
        height: 90px;
    }

    .fpc-gauge-track {
        width: 180px;
        height: 180px;
    }

    .fpc-gauge-track::before {
        top: 18px;
        left: 18px;
        width: 144px;
        height: 144px;
    }

    .fpc-gauge-pointer {
        height: 62px;
    }

    .fpc-gauge-value {
        font-size: 24px;
    }
}

/* ===== 반응형 - 작은 모바일 ===== */
@media (max-width: 480px) {
    .fpc-currency-options {
        flex-direction: column;
        gap: 6px;
    }

    .fpc-main-value {
        font-size: 34px;
    }

    .fpc-main-value .unit {
        font-size: 16px;
    }

    .fpc-detail-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .fpc-detail-card {
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        padding: 14px;
    }

    .fpc-detail-label {
        justify-content: flex-start;
        margin-bottom: 0;
    }

    .fpc-detail-value {
        font-size: 22px;
    }

    .fpc-gauge-wrapper {
        width: 160px;
        height: 80px;
    }

    .fpc-gauge-track {
        width: 160px;
        height: 160px;
    }

    .fpc-gauge-track::before {
        top: 16px;
        left: 16px;
        width: 128px;
        height: 128px;
    }

    .fpc-gauge-pointer {
        height: 55px;
    }

    .fpc-gauge-value {
        font-size: 20px;
    }

    .fpc-simulation-table {
        font-size: 11px;
    }

    .fpc-simulation-table th,
    .fpc-simulation-table td {
        padding: 8px 4px;
    }

    .fpc-target-input-group {
        flex-direction: column;
        gap: 8px;
    }

    .fpc-target-input-group button {
        width: 100%;
    }

    .fpc-compound-input-group {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
}
