/* ========================================
   인건비 및 주휴수당 계산기 스타일
   ======================================== */

* {
    box-sizing: border-box;
}

.calculator-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
}

/* ========== 헤더 ========== */
.calculator-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    color: white;
}

.calculator-title {
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.calculator-title .icon {
    font-size: 40px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.calculator-subtitle {
    font-size: 16px;
    margin: 0 0 15px 0;
    opacity: 0.95;
    font-weight: 500;
}

/* 기능 안내 배너 */
.feature-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 15px auto 0;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 14px;
    max-width: 90%;
    backdrop-filter: blur(10px);
    animation: slideInDown 0.5s ease;
}

.feature-notice.member {
    background: rgba(255, 215, 0, 0.95);
    color: #000;
    border: 2px solid rgba(255, 215, 0, 1);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.feature-notice.guest {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    border: 2px solid rgba(255, 255, 255, 1);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

.feature-notice .notice-icon {
    font-size: 20px;
    animation: bounce 2s infinite;
}

.feature-notice .notice-text {
    line-height: 1.4;
}

.feature-notice .notice-text strong {
    font-weight: 800;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-actions {
    text-align: center;
    margin-top: 15px;
}

.btn-manage {
    display: inline-block;
    padding: 14px 35px;
    background: white;
    color: #667eea;
    border: 3px solid white;
    border-radius: 30px;
    font-size: 17px;
    font-weight: 800;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: pulse 2s infinite;
}

.btn-manage:hover {
    background: #667eea;
    color: white;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 25px rgba(255, 255, 255, 0.5);
    animation: none;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* ========== 메인 레이아웃 ========== */
.calculator-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

/* ========== 입력 섹션 ========== */
.input-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 25px 0;
    color: #333;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #444;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-checkbox {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    vertical-align: middle;
}

.input-hint {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 6px;
}

.input-hint.help-text {
    color: #667eea;
    font-weight: 500;
}

.btn-calculate {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 30px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-calculate:active {
    transform: translateY(0);
}

/* ========== 결과 섹션 ========== */
.result-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

/* 화면용 직원 정보 헤더 */
.payslip-header {
    display: none; /* 기본은 숨김 (인쇄 시 JavaScript로 표시) */
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #e1e8ed;
}

.payslip-header.show {
    display: block; /* 계산 후 표시 */
}

.payslip-header .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.payslip-header .info-row:last-child {
    border-bottom: none;
}

.payslip-header .info-label {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    width: 30%;
}

.payslip-header .info-label::after {
    content: ' :';
    margin-left: 5px;
}

.payslip-header .info-value {
    font-size: 16px;
    font-weight: 700;
    color: #212529;
    width: 70%;
    text-align: right;
}

.result-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.result-card-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #495057;
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #dee2e6;
}

.result-row:last-child {
    border-bottom: none;
}

.result-row.total {
    border-top: 2px solid #667eea;
    margin-top: 10px;
    padding-top: 15px;
    font-weight: 700;
}

.result-row.final {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 18px;
    font-weight: 800;
}

.result-label {
    font-weight: 600;
    color: #495057;
}

.result-value {
    font-weight: 700;
    color: #212529;
    font-family: 'Courier New', monospace;
}

.result-value.highlight {
    color: #667eea;
    font-size: 18px;
}

.result-value.deduction {
    color: #dc3545;
}

.result-row.final .result-label,
.result-row.final .result-value {
    color: white;
}

/* ========== 공제 내역 ========== */
#deductionDetails .result-row {
    padding: 8px 0;
    font-size: 14px;
}

/* ========== 팁 섹션 ========== */
.tip-section {
    margin-top: 20px;
}

.tip-box {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
}

.tip-box.danger {
    background: #f8d7da;
    border-left-color: #dc3545;
}

.tip-box.info {
    background: #d1ecf1;
    border-left-color: #17a2b8;
}

.tip-box.success {
    background: #d4edda;
    border-left-color: #28a745;
}

.tip-box strong {
    display: block;
    margin-bottom: 5px;
    font-size: 15px;
}

.tip-box p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

/* ========== 공제 안내 ========== */
.insurance-notice {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px 15px;
    margin-bottom: 15px;
    border-radius: 6px;
}

.insurance-notice strong {
    display: block;
    color: #856404;
    font-size: 14px;
    margin-bottom: 8px;
}

.insurance-notice p {
    margin: 0;
    color: #856404;
    font-size: 13px;
    line-height: 1.6;
}

/* ========== 공유 버튼 ========== */
.share-section {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.btn-share {
    flex: 1;
    padding: 14px;
    background: #fee500;
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(254, 229, 0, 0.4);
    background: #fada0a;
}

.btn-share.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-share.primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8b 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-share.secondary {
    background: #495057;
    color: white;
}

.btn-share.secondary:hover {
    background: #343a40;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ========== 법적 고지사항 ========== */
.legal-notice {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    border: 2px solid #e9ecef;
}

.legal-notice h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #dc3545;
}

.legal-notice ul {
    margin: 0;
    padding-left: 20px;
}

.legal-notice li {
    margin-bottom: 8px;
    font-size: 14px;
    color: #495057;
    line-height: 1.6;
}

/* ========== 반응형 ========== */
@media (max-width: 768px) {
    .calculator-container {
        padding: 15px;
        margin: 20px auto;
    }

    .calculator-header {
        padding: 20px 15px;
    }

    .calculator-title {
        font-size: 24px;
    }

    .calculator-title .icon {
        font-size: 30px;
    }

    .calculator-subtitle {
        font-size: 14px;
        margin: 0 0 10px 0;
    }

    .feature-notice {
        flex-direction: column;
        text-align: center;
        padding: 10px 15px;
        font-size: 13px;
        max-width: 95%;
    }

    .feature-notice .notice-icon {
        font-size: 18px;
    }

    .btn-manage {
        padding: 12px 25px;
        font-size: 15px;
    }

    .calculator-body {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .input-section,
    .result-section {
        padding: 20px;
    }

    .section-title {
        font-size: 18px;
    }

    .result-card {
        padding: 15px;
    }

    .result-row {
        font-size: 14px;
    }

    .result-value.highlight {
        font-size: 16px;
    }

    .payslip-header {
        padding: 15px;
    }

    .payslip-header .info-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 0;
    }

    .payslip-header .info-label,
    .payslip-header .info-value {
        width: 100%;
        text-align: left;
    }

    .payslip-header .info-value {
        margin-top: 5px;
        font-size: 15px;
    }

    .share-section {
        flex-direction: column;
    }

    .btn-share {
        width: 100%;
    }
}

/* ========== 애니메이션 ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-section {
    animation: fadeIn 0.5s ease;
}

/* ========== 프린트 스타일 (서류 형태) ========== */
@media print {
    /* 인쇄 시 숨길 요소 */
    .calculator-header,
    .input-section,
    .share-section,
    .btn-calculate,
    .btn-share,
    .btn-manage,
    .header-actions,
    .feature-notice,
    .more-tips-notice,
    .tip-section {
        display: none !important;
    }
    
    /* 그누보드5 기본 레이아웃 요소 숨기기 */
    #wrapper,
    #container,
    #header,
    #footer,
    #gnb,
    #lnb,
    .header,
    .footer,
    .header-wrap,
    .footer-wrap,
    header,
    footer,
    nav,
    .navigation,
    .top-menu,
    .sitemap,
    .breadcrumb,
    .sns-share,
    aside,
    .sidebar,
    #skip_to_content,
    #side_to_top {
        display: none !important;
    }

    /* A4 용지 설정 - 한 장에 맞추기 */
    @page {
        size: A4 portrait;
        margin: 8mm 12mm 8mm 12mm;
    }

    /* 전체 페이지 기본 설정 */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    html, body {
        width: 100%;
        height: auto;
        margin: 0 !important;
        padding: 0 !important;
        font-family: '맑은 고딕', 'Malgun Gothic', sans-serif;
        font-size: 9pt;
        line-height: 1.3;
        color: #000;
        background: white;
    }
    
    /* 스크롤바만 숨기기 (내용은 유지) */
    ::-webkit-scrollbar {
        display: none;
    }

    .calculator-container {
        max-width: 100%;
        width: 100%;
        margin: 0 auto !important;
        padding: 0 !important;
        border: 2px solid #000;
        box-sizing: border-box;
        transform: scale(0.95);
        transform-origin: top center;
    }

    .calculator-body {
        display: block !important;
        padding: 10px;
        margin: 0;
    }

    /* 결과 섹션 */
    .result-section {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none;
        box-shadow: none;
        background: white;
        page-break-before: avoid;
        height: auto !important;
        overflow: visible !important;
    }

    /* 문서 제목 - 급여 명세서 */
    .result-section::before {
        content: '급 여 명 세 서';
        display: block;
        font-size: 18pt;
        font-weight: 900;
        text-align: center;
        letter-spacing: 8px;
        padding: 10px 0;
        margin-bottom: 12px;
        border-top: 3px double #000;
        border-bottom: 3px double #000;
        background: white;
    }
    
    /* 직원 정보 헤더 (JavaScript로 생성) - 인쇄 시 강제 표시 */
    .payslip-header {
        display: block !important; /* 인쇄 시 무조건 표시 */
        visibility: visible !important;
        opacity: 1 !important;
        width: 100%;
        margin-bottom: 10px;
        padding: 8px;
        background: white !important;
        border: 1.5px solid #000 !important;
        border-radius: 0 !important;
        page-break-inside: avoid;
        height: auto !important;
    }
    
    .payslip-header .info-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 3px 0;
        font-size: 9pt;
        border-bottom: 1px solid #ddd;
    }
    
    .payslip-header .info-row:last-child {
        border-bottom: none;
    }
    
    .payslip-header .info-label {
        font-weight: 700;
        color: #000;
        width: 30%;
    }
    
    .payslip-header .info-label::after {
        content: ' :';
    }
    
    .payslip-header .info-value {
        font-weight: 700;
        color: #000;
        width: 70%;
        text-align: right;
    }

    /* 섹션 제목 */
    .section-title {
        display: block !important;
        visibility: visible !important;
        font-size: 10pt;
        font-weight: 800;
        margin: 10px 0 5px 0;
        padding: 4px 6px;
        background: #f5f5f5 !important;
        border-left: 3px solid #000 !important;
        color: #000;
    }

    /* 결과 카드 - 테이블 형태 */
    .result-card {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100%;
        background: white !important;
        border: 1.5px solid #000 !important;
        border-radius: 0 !important;
        padding: 0;
        margin-bottom: 6px;
        page-break-inside: avoid;
        height: auto !important;
    }

    .result-card-title {
        font-size: 9pt;
        font-weight: 700;
        padding: 5px 8px;
        margin: 0;
        background: #e8e8e8 !important;
        border-bottom: 1px solid #000;
        color: #000;
    }

    /* 결과 행 - 테이블 행처럼 */
    .result-row {
        display: flex !important;
        visibility: visible !important;
        justify-content: space-between;
        align-items: center;
        padding: 4px 8px;
        border-bottom: 1px solid #ccc;
        font-size: 8pt;
        background: white !important;
    }

    .result-row:last-child {
        border-bottom: none;
    }

    /* 소계/합계 행 */
    .result-row.total {
        background: #f0f0f0 !important;
        border-top: 1.5px solid #000 !important;
        border-bottom: 1.5px solid #000 !important;
        margin: 0;
        padding: 5px 8px;
        font-weight: 800;
        font-size: 9pt;
    }

    /* 최종 실수령액 */
    .result-row.final {
        background: #000 !important;
        color: white !important;
        border: 2px solid #000 !important;
        border-radius: 0 !important;
        padding: 8px 8px;
        margin: 6px 0;
        font-size: 11pt;
        font-weight: 900;
    }

    .result-row.final .result-label,
    .result-row.final .result-value {
        color: white !important;
    }

    /* 라벨 */
    .result-label {
        font-weight: 600;
        color: #000;
        width: 60%;
    }

    /* 값 */
    .result-value {
        font-weight: 700;
        color: #000;
        text-align: right;
        width: 40%;
        font-family: 'Courier New', 'Consolas', monospace;
        font-size: 11pt;
    }

    .result-value.highlight {
        color: #000;
        font-weight: 800;
        font-size: 11pt;
    }

    .result-value.deduction {
        color: #000;
    }

    /* 공제 내역 상세 */
    #deductionDetails .result-row {
        font-size: 9pt;
        padding: 5px 10px;
    }
    
    /* 공제 안내 메시지 */
    .insurance-notice {
        background: #fffef0 !important;
        border: 1px solid #ccc !important;
        border-left: 3px solid #000 !important;
        padding: 8px 10px;
        margin-bottom: 8px;
        border-radius: 0;
    }
    
    .insurance-notice strong {
        display: block;
        font-size: 9pt;
        font-weight: 700;
        margin-bottom: 5px;
        color: #000 !important;
    }
    
    .insurance-notice p {
        font-size: 8pt;
        line-height: 1.4;
        color: #000 !important;
        margin: 0;
    }

    /* 법적 고지사항 */
    .legal-notice {
        margin-top: 10px;
        padding: 6px;
        border: 1px solid #999;
        border-radius: 0;
        background: #fafafa !important;
        font-size: 6pt;
        page-break-inside: avoid;
    }

    .legal-notice h3 {
        font-size: 7pt;
        font-weight: 700;
        margin: 0 0 3px 0;
        color: #000;
    }

    .legal-notice ul {
        margin: 3px 0 0 0;
        padding-left: 12px;
        list-style-type: disc;
    }

    .legal-notice li {
        margin-bottom: 2px;
        font-size: 6pt;
        color: #000;
        line-height: 1.2;
    }

    /* 발급일 표시 */
    .legal-notice::after {
        content: '발급일: ' attr(data-print-date);
        display: block;
        text-align: right;
        font-size: 7pt;
        color: #000;
        margin-top: 5px;
        padding-top: 3px;
        border-top: 1px solid #ddd;
        font-weight: 600;
    }

    /* 페이지 나누기 방지 */
    .payslip-header,
    .result-card,
    .legal-notice {
        page-break-inside: avoid;
    }

    /* 불필요한 여백 제거 */
    p, ul {
        margin: 0;
    }

    /* 색상 강제 적용 */
    .result-card,
    .payslip-header,
    .legal-notice {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

