/* ================================
   공통 레이아웃 스타일
   ================================ */

.base-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* ================================
   Flexbox 유틸리티 클래스
   ================================ */

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.flex-row {
    display: flex;
    flex-direction: row;
}

.flex-start {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.flex-end {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.flex-wrap {
    display: flex;
    flex-wrap: wrap;
}

/* ================================
   헤더 스타일
   ================================ */

.sub-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 20px;
    text-align: center;
}

.sub-header-left,
.sub-header-right {
    display: flex;
    align-items: center;
    min-width: 120px;
}

.sub-header-left {
    justify-content: flex-start;
}

.sub-header-right {
    justify-content: flex-end;
}

.sub-header-center {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    text-align: center;
}

.sub-header-center h2 {
    margin: 0;
    text-align: center;
    cursor: default;
}

.header-container img {
    width: 64px;
    height: 40px;
}

.sub-header-container img {
    width: 45px;
    height: 28px;
}

/* ================================
   타이포그래피
   ================================ */

h1 {
    color: #2c3e50;
    font-size: 36px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

h2 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0;
}

h3 {
    color: #2c3e50; 
    font-size: 22px; 
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 0;
}

h4 {
    color: #2c3e50; 
    font-size: 18px; 
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 0;
}

h5 {
    color: #2c3e50; 
    font-size: 14px; 
    font-weight: bold;
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 0;
}

p {
    color: #555;
    font-size: 14px;
    margin: 0;
}

/* ================================
   기본 스타일
   ================================ */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    margin: 0;
    padding: 0;
    background: white;
    min-height: 100vh;
    color: #333;
}

/* ================================
   공통 컨테이너 스타일
   ================================ */

.container-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.container-col {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.container-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ================================
   공통 버튼 스타일
   ================================ */

/* count-btn 스타일은 button.css로 이동됨 */

/* ================================
   공통 입력 필드 스타일
   ================================ */

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* ================================
   공통 라벨 스타일
   ================================ */

label {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

/* ================================
   공통 메시지 스타일
   ================================ */

.no-selection-message {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.empty-message {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* ================================
   오버레이 스타일
   ================================ */

.in-progress-overlay,
.pending-overlay,
.waiting-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.overlay-modal {
    background: white;
    padding: 40px;
    border-radius: 16px;
    min-width: 400px;
    max-width: 500px;
}

.overlay-modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.overlay-modal-header h3 {
    margin: 0;
    color: #212529;
    font-size: 24px;
    font-weight: 600;
}

.overlay-modal-content {
    text-align: center;
}

.progress-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
    display: block; /* 기본 스피너 다시 활성화 */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 원형 프로그레스바 */
.circular-progress-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
    /* in-progress 상태에서 사용 */
}

.circular-progress {
    transform: rotate(-90deg);
}

.circular-progress-bg {
    fill: none;
    stroke: #e9ecef;
    stroke-width: 12;
}

.circular-progress-bar {
    fill: none;
    stroke: #007bff;
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.3s ease;
}

.progress-percent-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: 600;
    color: #007bff;
}

/* 바형 프로그레스바 (pending 상태) */
.bar-progress-container {
    width: 100%;
    margin: 30px 0;
    display: none; /* 임시로 숨김 - 나중에 수정해서 사용 */
}

.bar-progress-bg {
    width: 100%;
    height: 24px;
    background-color: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
}

.bar-progress-fill {
    height: 100%;
    background-color: #007bff;
    border-radius: 12px;
    transition: width 0.3s ease;
}

.progress-message {
    color: #6c757d;
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
    white-space: pre-line;
}

/* ================================
   키 검증 오버레이 (일반화)
   ================================ */

.key-validation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.key-validation-modal {
    background: white;
    border-radius: 10px;
    padding: 35px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.key-validation-title {
    margin: 0 0 15px 0;
    font-size: 22px;
    font-weight: bold;
    color: #333;
    text-align: center;
}

.key-validation-description {
    margin: 0 0 25px 0;
    font-size: 14px;
    color: #6c757d;
    text-align: center;
    line-height: 1.5;
}

.key-validation-input-group {
    margin-bottom: 15px;
}

.key-validation-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.key-validation-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.key-validation-error {
    margin-bottom: 15px;
    padding: 12px 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    color: #721c24;
    font-size: 13px;
    text-align: center;
    line-height: 1.6;
}

.key-validation-error strong {
    font-weight: 600;
    color: #5a1a1a;
}

.key-validation-button-container {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.key-validation-cancel-button {
    padding: 10px 25px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s, border-color 0.2s;
}

.key-validation-cancel-button:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.key-validation-confirm-button {
    padding: 10px 25px;
    border: none;
    border-radius: 5px;
    background: #007bff;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.key-validation-confirm-button:hover {
    background: #0056b3;
}

.key-validation-confirm-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.key-validation-confirm-button:active {
    background: #004085;
}

