/**
 * modal.css
 * 모달 다이얼로그 스타일
 */

/* 모달 오버레이 */
#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}


/* 모달 컨테이너 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    pointer-events: none;
}


/* 모달 컨텐츠 */
/* 모달 컨텐츠 */
.modal-content {
    background-color: var(--bg-panel);
    border: 1px solid #000;
    border-radius: 0;
    box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.5);
    padding: 30px;
    min-width: 400px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    pointer-events: all;
    animation: modalFadeIn 0.25s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h2 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: normal;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* 모달 폼 */
.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-content label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 14px;
    font-weight: normal;
    color: var(--text-primary);
}

.modal-content input[type="text"],
.modal-content input[type="number"] {
    padding: 10px;
    font-size: 14px;
    background-color: #222;
    color: white;
    border: 1px solid #000;
    border-radius: 0;
    transition: none;
    font-family: 'Cafe24ProUp', sans-serif;
}

/* Hide number input spinners */
.modal-content input[type="number"]::-webkit-inner-spin-button,
.modal-content input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.modal-content input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.modal-content input[type="text"]:focus,
.modal-content input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: none;
}

/* Radio group */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.radio-label {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: #222;
    border: 1px solid #000;
    cursor: pointer;
    transition: background-color 0.2s;
}

.radio-label:hover {
    background-color: #2a2a2a;
}

.radio-label input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.radio-label input[type="radio"]:checked+span,
.radio-label:has(input[type="radio"]:checked) {
    background-color: #333;
    border-color: var(--primary-color);
}

/* Stepper buttons for Unicode Start */
.unicode-stepper {
    display: flex;
    gap: 0;
    height: 40px;
    margin-bottom: 5px;
    /* Spacing between label above and next label below */
}

.unicode-stepper input {
    flex: 1;
    text-align: center;
    height: 100% !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-left: none !important;
    border-right: none !important;
    margin: 0 !important;
}

.stepper-btn {
    width: 40px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background-color: #333;
    color: white;
    border: 1px solid #000;
    cursor: pointer;
    flex-shrink: 0;
    line-height: normal;
    padding: 0;
    margin: 0 !important;
    box-sizing: border-box;
}

/* Explicit hover with higher specificity and !important to override global button:hover if needed */
.unicode-stepper .stepper-btn:hover {
    background-color: #444 !important;
}

.stepper-btn:active {
    background-color: var(--primary-color) !important;
}

/* 모달 버튼 */
.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.modal-buttons button {
    padding: 10px 20px;
    font-size: 14px;
}

.cancel-button {
    background-color: #555;
    color: white;
}

.cancel-button:hover {
    background-color: #777;
}

/* 필수 입력 표시 */
.modal-content label.required::after {
    content: '*';
    color: var(--danger-color);
    margin-left: 4px;
}

/* 모달 리스트 */
.modal-content ul {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.modal-content li {
    padding: 8px 12px;
    margin: 5px 0;
    background-color: var(--bg-light);
    border-radius: 0;
    border: 1px solid #000;
    font-size: 13px;
}

/* 모달 스크롤바 */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background-color: var(--bg-light);
    border-radius: 0;
}

.modal-content::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 0;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background-color: #777;
}

/* 커스텀 다이얼로그 */
.dialog-content {
    min-width: 350px;
    max-width: 500px;
    text-align: center;
}

.dialog-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border-radius: 0;
    border: 1px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
}

.dialog-icon.success {
    background-color: #2ecc71;
    color: black;
}

.dialog-icon.success::before {
    content: '✓';
}

.dialog-icon.error {
    background-color: #e74c3c;
    color: white;
}

.dialog-icon.error::before {
    content: '✕';
}

.dialog-icon.warning {
    background-color: #f1c40f;
    color: black;
}

.dialog-icon.warning::before {
    content: '⚠';
}

.dialog-icon.info {
    background-color: #3498db;
    color: white;
}

.dialog-icon.info::before {
    content: 'ℹ';
}

.dialog-content h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: var(--text-primary);
}

.dialog-content p {
    margin: 0 0 25px 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-wrap;
}

.dialog-buttons {
    margin-top: 25px;
    justify-content: center;
}

#dialog-cancel {
    display: none;
}
