/* =================================================================
   Chatly Manager 공통 스타일시트 (v1.0)
================================================================= */

/* --- 1. 기본 & 레이아웃 --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}

.container-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h1, h2, h3 {
    color: #2c3e50;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
}

/* --- 2. 내비게이션 바 --- */
.navbar {
    background-color: #ffffff;
    padding: 0 40px;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 24px;
    font-weight: 700;
    color: #34495e;
    text-decoration: none;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.nav-links li a {
    display: block;
    padding: 20px 25px;
    text-decoration: none;
    color: #555;
    font-weight: 600;
    font-size: 16px;
    transition: color 0.3s, border-bottom 0.3s;
    border-bottom: 3px solid transparent;
}

.nav-links li a:hover {
    color: #007bff;
}

.nav-links li a.active {
    color: #007bff;
    border-bottom: 3px solid #007bff;
}

/* --- 3. 버튼 --- */
button, .button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s, transform 0.1s;
}

button:active {
    transform: translateY(1px);
}

.green { background-color: #27ae60; color: white; }
.green:hover { background-color: #219a52; }
.blue { background-color: #3498db; color: white; }
.blue:hover { background-color: #2980b9; }
.red { background-color: #e74c3c; color: white; }
.red:hover { background-color: #c0392b; }

.run-btn { background-color: #e74c3c; color: white; }
.run-btn:hover { background-color: #c0392b; }
.convert-btn { background-color: #3498db; color: white; }
.convert-btn:hover { background-color: #2980b9; }
.save-btn { background-color: #27ae60; color: white; }
.save-btn:hover { background-color: #219a52; }
.copy-btn { padding: 5px 10px; font-size: 12px; background-color: #7f8c8d; color: white; }
.copy-btn:hover { background-color: #6a7778; }
.button-row { display: flex; gap: 10px; justify-content: center; margin: 20px 0; }

/* --- 4. 폼 & 입력 요소 --- */
form { margin-bottom: 20px; }
fieldset {
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}
legend {
    font-weight: bold;
    color: #34495e;
    padding: 0 10px;
}
textarea {
    width: 100%;
    min-height: 400px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
}

/* 파일 업로드 */
.file-upload {
    margin-bottom: 20px;
    padding: 20px;
    border: 2px dashed #3498db;
    border-radius: 4px;
    text-align: center;
    background-color: #f8f9fa;
}
input[type="file"] { display: none; }
.file-label {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border-radius: 4px;
    cursor: pointer;
}
.file-label:hover { background-color: #2980b9; }

/* --- 5. 결과 및 로그 표시 --- */
.log-container {
    background-color: #2c3e50; /* 어두운 배경 */
    color: #ecf0f1; /* 밝은 글씨 */
    border: 1px solid #34495e;
    padding: 15px;
    border-radius: 5px;
    height: 600px;
    overflow-y: scroll;
    font-size: 14px;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* Plaintext to JSON 결과창 */
.grid-container { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.heading-with-button { display: flex; justify-content: space-between; align-items: center; }

/* 가져오기 결과 */
#import-results {
    margin-top: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 4px;
    display: none;
}
#import-results-log {
    display: none;
    margin-top: 20px;
    border-top: 2px solid #3498db;
    padding-top: 15px;
}
#import-log-content {
    background-color: #f8f9fa;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 4px;
    max-height: 300px;
    overflow-y: auto;
}
#import-log-content .log-success, #import-list li.success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 3px;
    border: 1px solid;
}
#import-log-content .log-error, #import-list li.error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
    font-weight: bold;
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 3px;
    border: 1px solid;
}
#import-list {
    list-style: none;
    padding: 0;
    max-height: 400px;
    overflow-y: auto;
}
.stats {
    background-color: #ecf0f1;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    margin-top: 20px;
}
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}