/* ===================================
   Download Page Styles
   =================================== */

/* Download Section */
.download-section {
    padding: 120px 0 80px;
    background: var(--bg-light);
    min-height: 100vh;
}

.download-section .section-header {
    margin-bottom: 48px;
}

/* Download Category */
.download-category {
    margin-bottom: 48px;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-radius: var(--radius-md);
}

.category-title i {
    font-size: 18px;
}

/* Program List */
.program-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.program-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.program-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.program-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.program-icon i {
    font-size: 28px;
    color: white;
}

.program-icon.kcms5 {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
}

.program-icon.kfilter {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
}

.program-icon.kcmsneo {
    background: linear-gradient(135deg, #f59e0b 0%, #fcd34d 100%);
}

.program-info {
    flex: 1;
}

.program-info h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.program-info p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.program-info strong {
    color: var(--primary);
}

.program-card .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* File Table */
.file-table-wrapper {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.file-table {
    width: 100%;
    border-collapse: collapse;
}

.file-table thead {
    background: var(--bg-light);
}

.file-table th {
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
    border-bottom: 2px solid var(--border-color);
}

.file-table th.col-no {
    width: 60px;
    text-align: center;
}

.file-table th.col-attach {
    width: 60px;
    text-align: center;
}

.file-table th.col-date {
    width: 100px;
    text-align: center;
}

.file-table th.col-views {
    width: 70px;
    text-align: center;
}

.file-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.file-table tbody tr:last-child {
    border-bottom: none;
}

.file-table tbody tr:hover {
    background: var(--bg-light);
}

.file-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.file-table td:first-child {
    text-align: center;
    color: var(--text-light);
}

.file-table td:nth-child(3),
.file-table td:nth-child(4),
.file-table td:nth-child(5) {
    text-align: center;
}

.file-table td a {
    color: var(--text-primary);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.file-table td a:hover {
    color: var(--primary);
}

/* File Icons */
.file-icon-pdf {
    color: #dc2626;
    font-size: 18px;
}

.file-icon-img {
    color: #059669;
    font-size: 18px;
}

.file-icon-hwp {
    color: #2b7cd0;
    font-size: 18px;
}

.file-icon-doc {
    color: #2b57d0;
    font-size: 18px;
}

/* Tags */
.tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    margin-right: 4px;
}

.tag-kftc {
    background: #dbeafe;
    color: #1e40af;
}

.tag-hyosung {
    background: #fee2e2;
    color: #dc2626;
}

.tag-nicepay {
    background: #d1fae5;
    color: #059669;
}

.tag-program {
    background: #fef3c7;
    color: #b45309;
}

/* Download Notice */
.download-notice {
    display: flex;
    gap: 20px;
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-sm);
    margin-top: 32px;
}

.notice-icon {
    flex-shrink: 0;
}

.notice-icon i {
    font-size: 28px;
    color: var(--primary);
}

.notice-content h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.notice-content ul {
    list-style: none;
}

.notice-content li {
    position: relative;
    padding-left: 16px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.notice-content li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
}

/* ===================================
   Security Warning Box (페이지 상단 안내)
   =================================== */
.security-warning-box {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fcd34d;
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 36px;
    box-shadow: var(--shadow-sm);
}

.security-warning-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.security-warning-header i {
    font-size: 24px;
    color: #d97706;
}

.security-warning-header h3 {
    font-size: 17px;
    font-weight: 700;
    color: #92400e;
    margin: 0;
}

.security-warning-desc {
    font-size: 14px;
    color: #78350f;
    line-height: 1.7;
    margin-bottom: 18px;
    word-break: keep-all;
}

.security-warning-desc strong {
    color: #92400e;
    font-weight: 700;
}

.security-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

/* 브라우저별 가이드 (Edge / Chrome 분리) */
.browser-guide-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
}

.browser-guide {
    background: white;
    border-radius: var(--radius-md);
    padding: 18px;
    border: 1px solid rgba(252, 211, 77, 0.5);
}

.browser-guide-edge {
    border-top: 3px solid #0078d4;
}

.browser-guide-chrome {
    border-top: 3px solid #34a853;
}

.browser-guide-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border-color);
}

.browser-guide-head h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.browser-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    color: white;
    letter-spacing: 0.3px;
}

.browser-badge.edge {
    background: #0078d4;
}

.browser-badge.chrome {
    background: #34a853;
}

.browser-badge.common {
    background: #475569;
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

/* 공통 실행 단계 블록 */
.common-run-block {
    background: white;
    border-radius: var(--radius-md);
    padding: 18px;
    border: 1px solid var(--border-color);
    border-top: 3px solid #475569;
    margin-bottom: 18px;
}

.common-run-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border-color);
}

.common-run-head i {
    color: #475569;
    font-size: 18px;
}

.common-run-head h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.security-step .step-number.gray {
    background: #475569;
}

.security-steps-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.security-steps-vertical .security-step {
    background: var(--bg-light);
    border: none;
    padding: 12px;
}

.security-step {
    background: white;
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    gap: 12px;
    border: 1px solid rgba(252, 211, 77, 0.5);
}

.security-step .step-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: #d97706;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.security-step .step-detail strong {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
    word-break: keep-all;
    line-height: 1.5;
}

.security-step .step-detail .kbd {
    display: inline-block;
    background: #fef3c7;
    color: #b45309;
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 12.5px;
    font-weight: 700;
    border: 1px solid #fcd34d;
    margin: 0 1px;
}

.security-step .step-detail p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
    word-break: keep-all;
}

.security-warning-help {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #92400e;
    background: rgba(255, 255, 255, 0.6);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    margin: 0;
}

.security-warning-help i {
    color: #d97706;
}

/* ===================================
   Download Modal (다운로드 클릭 시 팝업)
   =================================== */
.download-modal[hidden] {
    display: none;
}

.download-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.download-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.download-modal.active .download-modal-overlay {
    opacity: 1;
}

.download-modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    transform: translateY(20px) scale(0.96);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.download-modal.active .download-modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.download-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.05);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 16px;
    transition: background 0.15s ease;
    z-index: 2;
}

.download-modal-close:hover {
    background: rgba(15, 23, 42, 0.12);
    color: var(--text-primary);
}

.download-modal-header {
    text-align: center;
    padding: 32px 28px 20px;
    border-bottom: 1px solid var(--border-color);
}

.download-modal-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.download-modal-header h3 {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.download-modal-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    word-break: keep-all;
}

.download-modal-subtitle #downloadModalProgram {
    color: var(--primary);
    font-weight: 600;
}

.download-modal-body {
    padding: 22px 28px;
}

.download-modal-intro {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 18px;
    word-break: keep-all;
}

.download-modal-intro strong {
    color: var(--primary);
}

.download-modal-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.download-modal-steps li {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: var(--bg-light);
    padding: 14px 16px;
    border-radius: var(--radius-md);
}

.download-modal-steps .modal-step-num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.download-modal-steps li strong {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
    word-break: keep-all;
    line-height: 1.5;
}

.download-modal-steps .modal-keyword {
    display: inline;
    background: #fef3c7;
    color: #b45309;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
}

.download-modal-steps li span:not(.modal-step-num) {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    word-break: keep-all;
}

.modal-browser-block {
    margin-bottom: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.modal-browser-block.edge {
    border-top: 3px solid #0078d4;
    background: rgba(0, 120, 212, 0.03);
}

.modal-browser-block.chrome {
    border-top: 3px solid #34a853;
    background: rgba(52, 168, 83, 0.03);
}

.modal-browser-block.common {
    border-top: 3px solid #475569;
    background: rgba(71, 85, 105, 0.04);
}

.modal-browser-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.modal-browser-head strong {
    font-size: 14px;
    color: var(--text-primary);
}

.modal-browser-block .download-modal-steps {
    margin: 0;
    gap: 8px;
}

.modal-browser-block .download-modal-steps li {
    background: white;
    padding: 10px 12px;
}

.download-modal-help {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    background: rgba(59, 125, 216, 0.06);
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(59, 125, 216, 0.15);
}

.download-modal-help i {
    color: var(--primary);
}

.download-modal-help strong {
    color: var(--primary);
}

.download-modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 18px 28px 24px;
    border-top: 1px solid var(--border-color);
}

.download-modal-footer .btn {
    min-width: 110px;
    justify-content: center;
}

/* Responsive */
@media (max-width: 1024px) {
    .program-card {
        flex-wrap: wrap;
    }

    .program-card .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .download-section {
        padding: 100px 0 60px;
    }

    .program-card {
        padding: 20px;
    }

    .program-icon {
        width: 56px;
        height: 56px;
    }

    .program-icon i {
        font-size: 24px;
    }

    .category-title {
        font-size: 16px;
    }

    .file-table th.col-date,
    .file-table td:nth-child(4) {
        display: none;
    }

    .file-table th.col-views,
    .file-table td:nth-child(5) {
        display: none;
    }

    .download-notice {
        flex-direction: column;
        gap: 16px;
    }

    .security-warning-box {
        padding: 20px;
    }

    .security-warning-header h3 {
        font-size: 15px;
    }

    .security-warning-desc {
        font-size: 13px;
    }

    .security-steps {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .browser-guide-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .browser-guide {
        padding: 16px;
    }

    .modal-browser-block {
        padding: 12px 14px;
    }

    .download-modal-header {
        padding: 28px 22px 16px;
    }

    .download-modal-header h3 {
        font-size: 17px;
    }

    .download-modal-body {
        padding: 18px 22px;
    }

    .download-modal-footer {
        padding: 16px 22px 22px;
        flex-direction: column-reverse;
    }

    .download-modal-footer .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .download-section {
        padding: 90px 0 40px;
    }

    .download-category {
        margin-bottom: 36px;
    }

    .program-card {
        flex-direction: column;
        text-align: center;
    }

    .program-info h4 {
        font-size: 16px;
    }

    .file-table th,
    .file-table td {
        padding: 12px 10px;
        font-size: 13px;
    }

    .file-table th.col-no,
    .file-table td:first-child {
        width: 40px;
    }

    .file-table th.col-attach,
    .file-table td:nth-child(3) {
        width: 40px;
    }

    .tag {
        font-size: 10px;
        padding: 1px 5px;
    }
}
