/* ============================================
   Daily Worker Pay Calculator
   Prefix: dwpc
   ============================================ */

/* Layout (Rule 51: no max-width/margin:auto) */
.dwpc-main-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 24px;
}

.dwpc-input-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dwpc-result-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 20px;
    align-self: start;
}

/* Section */
.dwpc-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

.dwpc-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #5c5649;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dwpc-section-title i {
    color: #d4af37;
    font-size: 14px;
}

/* Tabs */
.dwpc-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    background: #f5f3f0;
    border-radius: 8px;
    padding: 4px;
}

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

.dwpc-tab.active {
    background: #fff;
    color: #2c2a25;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

.dwpc-tab:hover:not(.active) {
    color: #5c5649;
    background: rgba(255, 255, 255, 0.5);
}

/* Tab Content */
.dwpc-tab-content {
    display: none;
}

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

.dwpc-tab-content .dwpc-section + .dwpc-section {
    margin-top: 14px;
}

/* Input Group */
.dwpc-input-group {
    margin-bottom: 10px;
    max-width: 100%;
    box-sizing: border-box;
}

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

.dwpc-input-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #8c8578;
    margin-bottom: 6px;
}

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

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

.dwpc-amount-input::placeholder {
    color: #ccc;
    font-weight: 400;
}

/* Input with Button (wage + min-wage btn) */
.dwpc-input-with-btn {
    display: flex;
    gap: 6px;
    align-items: stretch;
}

.dwpc-input-with-btn .dwpc-amount-input {
    flex: 1;
    min-width: 0;
}

.dwpc-min-wage-btn {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #d4af37;
    background: #fdf8ec;
    border: 1px solid #f0e6c0;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}

.dwpc-min-wage-btn:hover {
    background: #faf0d4;
    border-color: #d4af37;
}

/* Korean Amount Display */
.dwpc-korean-amount {
    font-size: 11px;
    color: #d4af37;
    text-align: right;
    margin-top: 4px;
    min-height: 16px;
}

/* Select */
.dwpc-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px 12px;
    font-size: 13px;
    color: #2c2a25;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    background: #faf9f7;
    cursor: pointer;
    appearance: auto;
}

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

/* Radio Group */
.dwpc-radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.dwpc-radio-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #5c5649;
    cursor: pointer;
}

.dwpc-radio-item input[type="radio"] {
    accent-color: #d4af37;
    flex-shrink: 0;
}

/* Input Row (side by side) */
.dwpc-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Checkbox Group */
.dwpc-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.dwpc-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #5c5649;
    cursor: pointer;
}

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

.dwpc-checkbox-item span {
    line-height: 1.3;
}

/* Badge (mandatory label) */
.dwpc-badge {
    display: inline-block;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    background: #d4af37;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 4px;
}

/* Info Box (weekly hours display) */
.dwpc-info-box {
    padding: 10px 12px;
    font-size: 13px;
    color: #5c5649;
    background: #fdf8ec;
    border: 1px solid #f0e6c0;
    border-radius: 8px;
    margin-top: 8px;
}

.dwpc-info-box strong {
    color: #d4af37;
    font-weight: 600;
}

/* Insurance Note */
.dwpc-insurance-note {
    padding: 10px 12px;
    font-size: 12px;
    color: #5c5649;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    margin-top: 8px;
    line-height: 1.5;
}

/* Hint */
.dwpc-hint {
    font-size: 11px;
    color: #b0a99c;
    margin-top: 8px;
    line-height: 1.4;
}

/* Button Group */
.dwpc-btn-group {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-top: 14px;
}

.dwpc-calculate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #d4af37, #c4a030);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.25);
}

.dwpc-calculate-btn:hover {
    background: linear-gradient(135deg, #c4a030, #b4922a);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

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

.dwpc-reset-btn:hover {
    background: #ebe8e3;
}

/* Hidden */
.dwpc-hidden {
    display: none !important;
}

/* Waiting */
.dwpc-waiting {
    text-align: center;
    padding: 48px 20px;
    color: #b0a99c;
}

.dwpc-waiting i {
    font-size: 36px;
    margin-bottom: 12px;
    display: block;
}

.dwpc-waiting p {
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

/* Result Summary */
.dwpc-result-summary {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.dwpc-summary-title {
    font-size: 12px;
    font-weight: 500;
    color: #8c8578;
    margin-bottom: 4px;
}

.dwpc-summary-main {
    font-size: 32px;
    font-weight: 700;
    color: #d4af37;
    margin-bottom: 4px;
}

.dwpc-summary-main .dwpc-unit {
    font-size: 16px;
    font-weight: 500;
    margin-left: 2px;
}

.dwpc-summary-label {
    font-size: 11px;
    color: #b0a99c;
    margin-bottom: 16px;
}

.dwpc-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}

.dwpc-summary-row + .dwpc-summary-row {
    border-top: 1px solid #f5f3f0;
}

.dwpc-summary-row-label {
    color: #8c8578;
}

.dwpc-summary-row-value {
    font-weight: 600;
    color: #2c2a25;
}

/* Deduction Detail */
.dwpc-deduction-detail {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
}

.dwpc-deduction-table {
    display: flex;
    flex-direction: column;
}

.dwpc-deduction-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 13px;
    color: #5c5649;
}

.dwpc-deduction-row + .dwpc-deduction-row {
    border-top: 1px solid #f5f3f0;
}

.dwpc-deduction-header {
    font-weight: 600;
    color: #8c8578;
    font-size: 12px;
    padding-bottom: 8px;
}

.dwpc-deduction-subtotal {
    background: #faf9f7;
    padding: 8px 10px;
    margin: 4px -10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
    color: #5c5649;
}

.dwpc-deduction-grand {
    font-weight: 700;
    font-size: 14px;
    color: #d4af37;
    padding-top: 10px;
}

/* Small Note (소액부징수) */
.dwpc-small-note {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 10px;
    padding: 10px 12px;
    font-size: 12px;
    color: #27ae60;
    background: #f0faf0;
    border: 1px solid #d4edda;
    border-radius: 8px;
    line-height: 1.4;
}

.dwpc-small-note i {
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Employer Section */
.dwpc-employer-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
}

/* Chart */
.dwpc-chart-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

.dwpc-donut-wrap {
    position: relative;
    width: 100%;
    max-width: 220px;
    margin: 0 auto;
}

.dwpc-chart-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.dwpc-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #5c5649;
}

.dwpc-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dwpc-dot-net { background: #d4af37; }
.dwpc-dot-insurance { background: #7ec8e3; }
.dwpc-dot-tax { background: #e88e6a; }

/* Payslip Section */
.dwpc-payslip-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
}

.dwpc-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.dwpc-table-header .dwpc-section-title {
    margin-bottom: 0;
}

.dwpc-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;
}

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

/* Disclaimer */
.dwpc-disclaimer {
    display: flex;
    gap: 8px;
    padding: 14px 16px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    font-size: 11px;
    color: #8c8578;
    line-height: 1.5;
}

.dwpc-disclaimer i {
    color: #b0a99c;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

.dwpc-disclaimer strong {
    color: #5c5649;
}

/* ==============================
   Mobile Responsive
   ============================== */

@media (max-width: 900px) {
    .dwpc-main-layout {
        grid-template-columns: 1fr;
    }

    .dwpc-result-col {
        position: static;
    }

    .dwpc-input-col {
        width: 100%;
    }

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

    .dwpc-summary-main {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .dwpc-main-layout {
        gap: 12px;
    }

    .dwpc-section {
        padding: 14px;
        max-width: 100%;
        overflow: hidden;
    }

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

    .dwpc-summary-main {
        font-size: 24px;
    }

    .dwpc-result-summary,
    .dwpc-deduction-detail,
    .dwpc-employer-section,
    .dwpc-chart-section,
    .dwpc-payslip-section {
        max-width: 100%;
        overflow: hidden;
    }

    .dwpc-input-with-btn {
        flex-direction: column;
    }

    .dwpc-input-with-btn .dwpc-amount-input {
        width: 100%;
    }
}
