/* exam_apply.css */

/* 전체 레이아웃/카드 스타일 */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;

    --level1-color: #dc3545;
    /* 1급(빨간) */
    --level2-color: #198754;
    /* 2급(초록) */
    --level3-color: #0d6efd;
    /* 3급(파랑) */

    --gradient-primary: linear-gradient(to right, #0d6efd, #0099f7);
    --gradient-success: linear-gradient(to right, #198754, #00c9a7);
    --gradient-danger: linear-gradient(to right, #dc3545, #ff6a75);
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: #f5f5f5;
    color: var(--dark-color);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 10px !important;
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.card-header {
    padding: 0px 0px 10px 20px!important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px 12px 0 0;
 
}

.card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.nav-tabs {
    margin-bottom: 25px;
    border-bottom: 2px solid var(--light-color);
}

.nav-tabs .nav-item {
    flex: 1;
    text-align: center;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 8px 8px 0 0;
    font-weight: 500;
    color: var(--secondary-color);
    transition: all 0.3s ease;
    width: 100%;
    border-bottom: 1px solid #bbb;
}

.nav-tabs .nav-link.active {
    border-bottom: 3px solid #f33;
    color: #f33;
    border: 1px solid #f33;
}

.empty-state {
    padding: 60px 20px;
    text-align: center;
    background-color: #f8f9fa;
    border-radius: 8px;
}

/* 자격증 카드 */
.certificate-cards-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.certificate-card {
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    position: relative;
    margin-bottom: 1rem;
}

.certificate-card-inner {
    display: flex;
    align-items: stretch;
    color: #fff;
}

.certificate-badge-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    min-width: 80px;
}

.certificate-badge {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #d4af37, #f9d423);
    /* 디폴트(1급) */
    color: #000;
}

.level-1 .certificate-card-inner {
    background: linear-gradient(135deg, #2c3e50, #1a2530);
    border-left: 3px solid #f9d423;
}

.level-2 .certificate-card-inner {
    background: linear-gradient(135deg, #2c3e50, #1a2530);
    border-left: 3px solid #d7dde8;
}

.level-3 .certificate-card-inner {
    background: linear-gradient(135deg, #2c3e50, #1a2530);
    border-left: 3px solid #e3b04b;
}

.certificate-badge.level-1 {
    background: linear-gradient(135deg, #d4af37, #f9d423);
    color: #000;
}

.certificate-badge.level-2 {
    background: linear-gradient(135deg, #757f9a, #d7dde8);
    color: #000;
}

.certificate-badge.level-3 {
    background: linear-gradient(135deg, #b78628, #e3b04b);
    color: #000;
}

.certificate-details {
    flex: 1;
    padding: 1rem;
    position: relative;
}

.certificate-level-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #fff;
}

.certificate-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
}

.info-value {
    font-size: 0.65rem;
    font-weight: 500;
    color:rgb(207, 190, 32)

}

.certificate-actions {
    text-align: right;
    margin-top: 0.5rem;
}

.certificate-actions .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

/* 시험신청 폼 */
.exam-level-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.exam-level-option {
    flex: 1;
    min-width: 200px;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 15px;
    position: relative;
    transition: all 0.3s ease;
}

.exam-level-option.active {
    border-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.05);
}

.exam-level-option.disabled {
    display: none;
}

.level-badge.level3 {
    background: linear-gradient(135deg, #b78628, #e3b04b);
    color: #000;
}

.level-badge.level2 {
    background: linear-gradient(135deg, #757f9a, #d7dde8);
    color: #000;
}

.level-badge.level1 {
    background: linear-gradient(135deg, #d4af37, #f9d423);
    color: #000;
}

.level-details {
    margin-top: 5px;
}

.form-check-input {
    display: none !important;
}


.form-control{
    background-color: #f8f9fa;
    font-size: 0.8rem;
}


.rem-10 {
    font-size: 1rem;
}

.rem-11 {
    font-size: 1.1rem;
}

/* 이미지 미리보기 */
.image-preview-container {
    text-align: center;
}

.image-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    border: 1px solid #ddd;
    display: none;
}

/* 자격증 모달 & 뷰어 */
.certificate-outer {
    position: relative;
    width:80%;
    padding-top: 141.42%; /* A4 비율로 변경 (1:1.4142) */
    background-color: #f9f9f9;
    overflow: hidden;
    margin: 0 auto;
    cursor: grab;
    max-height: none; /* 최대 높이 제한 제거 */
}

/* 모달 크기 조정 */
#certificateModal .modal-dialog {
    max-width: 800px; /* 고정 너비로 변경 */
    margin: 1.75rem auto;
}

#certificateModal .modal-content {
    max-height: 90vh; /* 모달 높이 제한 증가 */
    overflow: hidden; /* 스크롤 제거 */
}

.certificate-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../assets/bg_certi.png') no-repeat center center;
    background-size: contain; /* 배경 이미지가 온전히 보이도록 설정 */
    transform-origin: center center;
    padding-top: 0; /* 상단 패딩 제거 */
    margin-top: -15%; /* 상단 여백 줄이기 */
}

.certificate-field {
    position: absolute;
    transform: translate(-50%, -50%);
    color: #3290dd;
    font-weight: 700;
    font-family: 'Noto Serif KR', serif;
    white-space: nowrap; /* 텍스트 줄바꿈 방지 */
}

/* 필드 위치 및 크기 조정 - 모든 필드의 top 값을 줄여서 위로 이동 */
.field-cno {
    top: 36.5%;
    left: 44%;
    font-size: 18px;
}

.field-name {
    top: 39.5%;
    left: 40.5%;
    font-size: 22px;
}

.field-birth {
    top: 42.5%;
    left: 43%;
    font-size: 18px;
}

.field-certname {
    top: 45%;
    left: 49.3%;
    color: #0d68bd;
    font-size: 20px;
    font-weight: bold;
    z-index: 5;
    display: block;
}

.field-photo {
    top: 42%;
    left: 80%;
    width: 18%;
    height: 12%; 
    border: 0px solid #ccc;
    background: #fff;
    overflow: hidden;
    position: absolute;
    z-index: 10;
    transform: translate(-50%, -50%);
}

.field-photo img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.field-examdate {
    top: 48%;
    left: 35%;
    color: #353141;
    font-size: 18.5px;
    font-weight: 500;
}

.field-issuedate {
    top: 67%;
    left: 49.5%;
    color: #241a19;
    font-size: 18px;
}

.certificate-controls {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 6px 8px;
    border-radius: 30px;
    z-index: 10;
}

.certificate-controls button {
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
}

.certificate-controls .zoom-level {
    display: flex;
    align-items: center;
    padding: 0 6px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* 반응형 조정 */
@media (max-width: 768px) {
    #certificateModal .modal-dialog {
        max-width: 95%;
        margin: 0.5rem auto;
        top:30px;
    }
    
    .certificate-outer {
        padding-top: 141.42%; /* A4 비율 유지 */
    }
    
    /* 모바일에서 글자 크기 조정 */
    .field-cno { font-size: 12px; }
    .field-name { font-size: 14px; }
    .field-birth { font-size: 12px; }
    .field-certname { font-size: 16px; }
    .field-examdate { font-size: 14px; }
    .field-issuedate { font-size: 12px; }
}

/* 인쇄 설정 개선 */
@media print {
    body * {
        visibility: hidden;
    }

    .modal.show,
    .modal.show * {
        visibility: visible;
    }

    .modal-dialog {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
    }
    
    .modal-content {
        border: none !important;
        box-shadow: none !important;
        height: 100vh !important;
        overflow: visible !important;
    }

    .certificate-outer {
        width: 100% !important;
        height: 100% !important;
        padding-top: 0 !important; /* 패딩 제거 */
        transform: none !important;
        max-height: none !important;
        page-break-inside: avoid !important; /* 페이지 나눔 방지 */
        page-break-after: avoid !important;
        page-break-before: avoid !important;
    }

    .certificate-inner {
        width: 100% !important;
        height: 100% !important;
        background-size: contain !important;
        background-position: center !important;
        transform: none !important;
        margin: 0 auto !important;
        padding: 0 !important;
        position: relative !important;
        page-break-inside: avoid !important;
    }

    .certificate-controls, 
    .modal-header,
    .modal-footer {
        display: none !important;
    }
    
    /* 인쇄 시 필드 위치 조정 - 화면 보기와 동일하게 */
    .field-cno { 
        font-size: 18px !important; 
        top: 33.5% !important; 
        left: 44% !important;
    }
    
    .field-name { 
        font-size: 22px !important; 
        top: 37% !important; 
        left: 41.5% !important;
    }
    
    .field-birth { 
        font-size: 18px !important; 
        top: 40% !important; 
        left: 43.5% !important;
    }
    
    .field-certname { 
        font-size: 20px !important; 
        top: 43.5% !important; 
        left: 49.3% !important;
        display: block !important; 
        color: #0d68bd !important;
        font-weight: bold !important;
    }
    
    .field-examdate { 
        font-size: 19px !important; 
        top: 47.5% !important; 
        left: 35.5% !important;
        color: #353141 !important;
    }
    
    .field-issuedate { 
        font-size: 18px !important; 
        top: 72% !important; 
        left: 49.5% !important;
        color: #241a19 !important;
    }
    
    .field-photo {
        top: 38.5% !important;
        left: 76% !important;
        width: 16% !important;
        height: 12% !important;
        border: 0px solid #ccc !important;
        background: #fff !important;
        z-index: 10 !important;
        display: block !important;
        position: absolute !important;
        transform: translate(-50%, -50%) !important;
    }
    
    .field-photo img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    
    /* 인쇄 시 페이지 설정 */
    @page {
        size: A4 portrait !important;
        margin: 0 !important;
    }
}

/* 기타 반응형 */
@media (max-width:576px) {
    .certificate-field {
        font-size: 2vw;
    }
}