/* ===== 물왕코인 환전소 ===== */
.cex-wrap { max-width:960px; margin:0 auto; padding:16px; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif; }

/* 히어로 대시보드 */
.cex-hero {
    background:linear-gradient(135deg,#0f0c29 0%,#302b63 50%,#24243e 100%);
    border-radius:16px; padding:28px 24px 20px; color:#fff; position:relative; overflow:hidden;
    margin-bottom:20px; box-shadow:0 8px 32px rgba(0,0,0,0.25);
}
.cex-hero::before {
    content:''; position:absolute; top:-60px; right:-60px; width:200px; height:200px;
    background:rgba(241,196,15,0.08); border-radius:50%;
}
.cex-hero::after {
    content:''; position:absolute; bottom:-30px; left:20%; width:120px; height:120px;
    background:rgba(26,188,156,0.06); border-radius:50%;
}
.cex-hero-top {
    display:flex; align-items:flex-start; justify-content:space-between;
    position:relative; z-index:1; flex-wrap:wrap; gap:16px;
}
.cex-hero-title {
    font-size:13px; color:rgba(255,255,255,0.45); font-weight:500;
    letter-spacing:1px; text-transform:uppercase; margin-bottom:10px;
}
.cex-hero-rate-area { flex:1; min-width:200px; }
.cex-hero-rate-label { font-size:13px; color:rgba(255,255,255,0.5); margin-bottom:4px; }
.cex-hero-rate-value { font-size:42px; font-weight:800; letter-spacing:-2px; line-height:1.1; }
.cex-hero-rate-value span { font-size:18px; font-weight:400; color:rgba(255,255,255,0.6); }
.cex-hero-change { font-size:15px; font-weight:600; margin-top:6px; }
.cex-hero-change small { font-size:11px; color:rgba(255,255,255,0.4); margin-left:4px; }
.cex-hero-chart { width:220px; height:80px; flex-shrink:0; }

.cex-stats-row {
    display:flex; gap:10px; margin-top:20px; position:relative; z-index:1; flex-wrap:wrap;
}
.cex-stat-card {
    flex:1; min-width:100px; background:rgba(255,255,255,0.08); border-radius:10px;
    padding:12px 14px; text-align:center;
}
.cex-stat-label { font-size:11px; color:rgba(255,255,255,0.45); }
.cex-stat-val { font-size:17px; font-weight:700; margin-top:3px; }

/* 잔액 바 */
.cex-balance-bar { display:flex; gap:12px; margin-bottom:20px; flex-wrap:wrap; }
.cex-balance-item {
    flex:1; min-width:140px; background:#fff; border-radius:12px; padding:16px 20px;
    box-shadow:0 2px 12px rgba(0,0,0,0.06); display:flex; align-items:center; gap:12px;
}
.cex-balance-icon {
    width:44px; height:44px; border-radius:12px; display:flex; align-items:center;
    justify-content:center; font-size:20px; flex-shrink:0;
}
.cex-balance-icon.coin { background:linear-gradient(135deg,#f1c40f,#e67e22); color:#fff; }
.cex-balance-icon.point { background:linear-gradient(135deg,#3498db,#2980b9); color:#fff; }
.cex-balance-label { font-size:12px; color:#95a5a6; }
.cex-balance-val { font-size:20px; font-weight:700; color:#2c3e50; }
.cex-balance-val small { font-size:13px; font-weight:400; color:#7f8c8d; }

/* 탭 */
.cex-tabs {
    display:flex; background:#fff; border-radius:12px; overflow:hidden;
    box-shadow:0 2px 12px rgba(0,0,0,0.06); margin-bottom:24px;
}
.cex-tab {
    flex:1; padding:14px 12px; text-align:center; font-weight:600; font-size:14px;
    color:#95a5a6; cursor:pointer; border:none; background:transparent;
    border-bottom:3px solid transparent; transition:all 0.2s;
}
.cex-tab:hover { color:#302b63; background:#f8f7ff; }
.cex-tab.active { color:#302b63; border-bottom-color:#f1c40f; background:#f8f7ff; }
.cex-tab i { margin-right:5px; }

/* 패널 */
.cex-panel { display:none; }
.cex-panel.active { display:block; }

/* 환전 폼 그리드 */
.cex-exchange-grid { display:flex; gap:20px; margin-bottom:24px; flex-wrap:wrap; }
.cex-exchange-card {
    flex:1; min-width:280px; background:#fff; border-radius:14px; padding:24px;
    box-shadow:0 2px 16px rgba(0,0,0,0.06); position:relative; overflow:hidden;
}
.cex-exchange-card::before {
    content:''; position:absolute; top:0; left:0; right:0; height:4px;
}
.cex-exchange-card.coin-to-point::before { background:linear-gradient(90deg,#f1c40f,#e67e22); }
.cex-exchange-card.point-to-coin::before { background:linear-gradient(90deg,#3498db,#2980b9); }
.cex-exchange-card h3 { font-size:16px; color:#2c3e50; margin:0 0 6px; font-weight:700; }
.cex-exchange-card .card-desc { font-size:12px; color:#95a5a6; margin-bottom:16px; }
.cex-input-group { margin-bottom:14px; }
.cex-input-group label { display:block; font-size:12px; color:#7f8c8d; margin-bottom:5px; font-weight:500; }
.cex-input-row { display:flex; align-items:center; }
.cex-input-row input {
    flex:1; padding:12px 14px; border:1px solid #e0e0e0; border-radius:8px;
    font-size:16px; font-weight:600; color:#2c3e50; box-sizing:border-box;
    transition:border-color 0.2s;
}
.cex-input-row input:focus { border-color:#302b63; outline:none; box-shadow:0 0 0 3px rgba(48,43,99,0.1); }
.cex-input-row .cex-unit { padding:0 12px; font-size:14px; font-weight:600; color:#95a5a6; white-space:nowrap; }
.cex-max-btn {
    background:#eee; border:none; border-radius:6px; padding:4px 10px; font-size:11px;
    cursor:pointer; color:#555; margin-left:6px; font-weight:600;
}
.cex-max-btn:hover { background:#ddd; }
.cex-preview {
    background:#f8f9fa; border-radius:8px; padding:12px; margin-bottom:16px; font-size:13px; color:#555;
}
.cex-preview-result { font-size:20px; font-weight:700; color:#302b63; margin:4px 0; }
.cex-preview-fee { font-size:12px; color:#e74c3c; }
.cex-btn {
    display:block; width:100%; padding:13px; border:none; border-radius:10px;
    font-size:15px; font-weight:700; cursor:pointer; transition:all 0.2s; text-align:center;
}
.cex-btn:hover { transform:translateY(-1px); }
.cex-btn:disabled { opacity:0.5; cursor:not-allowed; transform:none; }
.cex-btn-coin { background:linear-gradient(135deg,#f1c40f,#e67e22); color:#1a1a2e; }
.cex-btn-point { background:linear-gradient(135deg,#3498db,#2980b9); color:#fff; }

/* 환율 차트 */
.cex-chart-section {
    background:#fff; border-radius:14px; padding:24px; box-shadow:0 2px 16px rgba(0,0,0,0.06);
    margin-bottom:24px;
}
.cex-chart-section h3 { font-size:16px; color:#2c3e50; margin:0 0 16px; font-weight:700; }
.cex-chart-canvas-wrap { position:relative; width:100%; height:240px; }
.cex-chart-canvas-wrap canvas { width:100%; height:100%; }

/* 쿠폰 그리드 */
.cex-coupon-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:16px; }
.cex-coupon-card {
    background:#fff; border-radius:14px; padding:20px; box-shadow:0 2px 12px rgba(0,0,0,0.06);
    position:relative; overflow:hidden; transition:transform 0.2s;
}
.cex-coupon-card:hover { transform:translateY(-2px); box-shadow:0 4px 20px rgba(0,0,0,0.1); }
.cex-coupon-badge {
    display:inline-block; padding:3px 10px; border-radius:20px; font-size:11px; font-weight:700;
    margin-bottom:10px;
}
.cex-coupon-badge.percent { background:#e8f8f5; color:#1abc9c; }
.cex-coupon-badge.fixed { background:#fdf2e9; color:#e67e22; }
.cex-coupon-name { font-size:16px; font-weight:700; color:#2c3e50; margin-bottom:4px; }
.cex-coupon-shop { font-size:13px; color:#7f8c8d; margin-bottom:8px; }
.cex-coupon-desc { font-size:12px; color:#95a5a6; margin-bottom:14px; line-height:1.5; }
.cex-coupon-footer { display:flex; align-items:center; justify-content:space-between; }
.cex-coupon-price { font-size:18px; font-weight:800; color:#302b63; }
.cex-coupon-price small { font-size:12px; font-weight:400; color:#95a5a6; }
.cex-coupon-stock { font-size:11px; color:#95a5a6; margin-top:2px; }
.cex-coupon-buy-btn {
    background:linear-gradient(135deg,#f1c40f,#e67e22); color:#1a1a2e; border:none;
    padding:8px 18px; border-radius:8px; font-size:13px; font-weight:700; cursor:pointer;
    transition:all 0.2s;
}
.cex-coupon-buy-btn:hover { transform:scale(1.04); }
.cex-coupon-buy-btn:disabled { opacity:0.5; cursor:not-allowed; }

/* 내 쿠폰 서브탭 */
.cex-my-tabs { display:flex; gap:8px; margin-bottom:16px; flex-wrap:wrap; }
.cex-my-tab {
    padding:8px 18px; border-radius:20px; border:1px solid #e0e0e0; background:#fff;
    font-size:13px; cursor:pointer; color:#7f8c8d; font-weight:500; transition:all 0.2s;
}
.cex-my-tab.active { background:#302b63; color:#fff; border-color:#302b63; }
.cex-my-tab .tab-count { font-size:11px; margin-left:4px; opacity:0.7; }
.cex-my-panel { display:none; }
.cex-my-panel.active { display:block; }

/* 보유 쿠폰 카드 */
.cex-owned-card {
    background:#fff; border-radius:12px; padding:18px; margin-bottom:12px;
    box-shadow:0 2px 8px rgba(0,0,0,0.05); display:flex; align-items:center; gap:16px; flex-wrap:wrap;
}
.cex-owned-card.used { opacity:0.5; }
.cex-owned-card.expired { opacity:0.4; }
.cex-owned-info { flex:1; min-width:180px; }
.cex-owned-name { font-size:15px; font-weight:700; color:#2c3e50; }
.cex-owned-shop { font-size:12px; color:#7f8c8d; margin-top:2px; }
.cex-owned-meta { display:flex; gap:16px; margin-top:8px; flex-wrap:wrap; }
.cex-owned-meta span { font-size:12px; color:#95a5a6; }
.cex-owned-meta .code { font-family:monospace; font-weight:600; color:#302b63; background:#f0f0ff; padding:2px 8px; border-radius:4px; }
.cex-owned-actions { flex-shrink:0; }
.cex-use-btn {
    background:#27ae60; color:#fff; border:none; padding:8px 20px; border-radius:8px;
    font-size:13px; font-weight:700; cursor:pointer; transition:background 0.2s;
}
.cex-use-btn:hover { background:#219a52; }
.cex-status-badge {
    display:inline-block; padding:4px 12px; border-radius:12px; font-size:11px; font-weight:600;
}
.cex-status-badge.badge-used { background:#eee; color:#999; }
.cex-status-badge.badge-expired { background:#fde8e8; color:#e74c3c; }

/* 거래내역 테이블 */
.cex-history-table {
    width:100%; border-collapse:collapse; background:#fff; border-radius:12px;
    overflow:hidden; box-shadow:0 2px 12px rgba(0,0,0,0.06);
}
.cex-history-table th {
    background:#f8f9fa; padding:12px 14px; font-size:12px; color:#7f8c8d; font-weight:600;
    text-align:left; border-bottom:1px solid #eee;
}
.cex-history-table td { padding:12px 14px; font-size:13px; color:#2c3e50; border-bottom:1px solid #f5f5f5; }
.cex-history-table tr:last-child td { border-bottom:none; }
.cex-type-icon {
    display:inline-flex; align-items:center; justify-content:center;
    width:28px; height:28px; border-radius:8px; font-size:13px; margin-right:8px;
}
.cex-type-icon.ctp { background:#fff3cd; color:#e67e22; }
.cex-type-icon.ptc { background:#d4edfc; color:#2980b9; }
.cex-type-icon.ctc { background:#e8f8f5; color:#1abc9c; }
.cex-status { display:inline-block; padding:3px 10px; border-radius:12px; font-size:11px; font-weight:600; }
.cex-status.completed { background:#e8f8f5; color:#27ae60; }
.cex-status.pending { background:#fff8e1; color:#f39c12; }
.cex-status.cancelled { background:#fde8e8; color:#e74c3c; }

/* 페이지네이션 */
.cex-pagination { text-align:center; margin-top:20px; }
.cex-pagination button {
    background:#fff; border:1px solid #e0e0e0; padding:8px 14px; margin:0 3px;
    border-radius:6px; cursor:pointer; font-size:13px; color:#555;
}
.cex-pagination button.active { background:#302b63; color:#fff; border-color:#302b63; }
.cex-pagination button:hover:not(.active) { background:#f5f5f5; }
.cex-pagination button:disabled { opacity:0.4; cursor:not-allowed; }

/* 모달 */
.cex-modal-overlay {
    display:none; position:fixed; top:0; left:0; right:0; bottom:0;
    background:rgba(0,0,0,0.5); z-index:9999; align-items:center; justify-content:center;
}
.cex-modal-overlay.show { display:flex; }
.cex-modal {
    background:#fff; border-radius:16px; padding:28px; max-width:400px; width:90%;
    box-shadow:0 20px 60px rgba(0,0,0,0.3); text-align:center;
}
.cex-modal h4 { font-size:18px; color:#2c3e50; margin:0 0 12px; }
.cex-modal p { font-size:14px; color:#555; margin-bottom:6px; line-height:1.5; }
.cex-modal .modal-highlight { font-size:24px; font-weight:800; color:#302b63; margin:12px 0; }
.cex-modal-btns { display:flex; gap:10px; margin-top:20px; }
.cex-modal-btns button { flex:1; padding:12px; border-radius:10px; font-size:14px; font-weight:700; cursor:pointer; border:none; }
.cex-modal-cancel { background:#eee; color:#555; }
.cex-modal-cancel:hover { background:#ddd; }
.cex-modal-confirm { background:linear-gradient(135deg,#f1c40f,#e67e22); color:#1a1a2e; }
.cex-modal-confirm:hover { transform:translateY(-1px); box-shadow:0 4px 12px rgba(241,196,15,0.4); }

/* 로그인 안내 */
.cex-login-notice {
    background:#fff; border-radius:14px; padding:40px 24px; text-align:center;
    box-shadow:0 2px 16px rgba(0,0,0,0.06); margin-bottom:20px;
}
.cex-login-notice i { font-size:48px; color:#ddd; display:block; margin-bottom:12px; }
.cex-login-notice p { font-size:14px; color:#95a5a6; margin-bottom:16px; }
.cex-login-btn {
    display:inline-block; background:linear-gradient(135deg,#302b63,#24243e); color:#fff;
    padding:12px 32px; border-radius:10px; text-decoration:none; font-weight:700; font-size:14px;
}
.cex-login-btn:hover { opacity:0.9; color:#fff; text-decoration:none; }

/* 빈 상태 */
.cex-empty { text-align:center; padding:48px 20px; color:#95a5a6; }
.cex-empty i { font-size:48px; display:block; margin-bottom:12px; opacity:0.3; }
.cex-empty p { font-size:14px; }

/* 토스트 */
.cex-toast {
    position:fixed; bottom:30px; left:50%; transform:translateX(-50%) translateY(100px);
    background:#302b63; color:#fff; padding:14px 28px; border-radius:12px;
    font-size:14px; font-weight:600; z-index:10000; box-shadow:0 8px 32px rgba(0,0,0,0.2);
    transition:transform 0.3s ease; white-space:nowrap; max-width:90%;
}
.cex-toast.show { transform:translateX(-50%) translateY(0); }
.cex-toast.error { background:#e74c3c; }
.cex-toast.success { background:#27ae60; }

/* 반응형 */
@media (max-width:768px) {
    .cex-wrap { padding:10px; }
    .cex-hero { padding:20px 16px 16px; border-radius:12px; }
    .cex-hero-rate-value { font-size:32px; }
    .cex-hero-chart { width:160px; height:60px; }
    .cex-exchange-grid { flex-direction:column; }
    .cex-exchange-card { min-width:auto; }
    .cex-tab { font-size:12px; padding:12px 8px; }
    .cex-tab i { display:none; }
    .cex-balance-bar { flex-direction:column; }
    .cex-history-table { font-size:12px; }
    .cex-history-table th, .cex-history-table td { padding:10px 8px; }
    .cex-coupon-grid { grid-template-columns:1fr; }
    .cex-owned-card { flex-direction:column; align-items:flex-start; }
}
@media (max-width:480px) {
    .cex-hero-top { flex-direction:column; }
    .cex-hero-chart { width:100%; height:60px; }
    .cex-stats-row { flex-direction:column; }
    .cex-my-tabs { flex-wrap:wrap; }
}
