:root {
    --bg-color: #f0f2f5;
    --container-bg: #ffffff;
    --text-color: #333333;
    --button-bg: #ffd43b; /* 밝은 노란색 */
    --button-hover: #fab005; /* 진한 노란색 */
    --button-text: #333333;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --container-bg: #2d2d2d;
    --text-color: #f0f2f5;
    --button-bg: #fcc419;
    --button-hover: #f59f00;
    --button-text: #1a1a1a;
    --shadow-color: rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Pretendard', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    text-align: center;
    background-color: var(--container-bg);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 20px var(--shadow-color);
    transition: background-color 0.3s, box-shadow 0.3s;
    position: relative;
    max-width: 900px;
    width: 95%;
}

.header-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
}

#theme-button, #lang-button {
    background: none;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

#theme-button:hover, #lang-button:hover {
    background-color: var(--text-color);
    color: var(--container-bg);
}

h1 {
    font-size: 24px;
    margin-bottom: 20px;
}

/* 가로 배치 레이아웃 */
.main-content-grid {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin: 40px 0;
    flex-wrap: wrap;
}

.card-section {
    flex: 1;
    min-width: 300px;
    padding: 30px;
    background-color: var(--bg-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* 상단부터 정렬 */
    transition: transform 0.3s;
    text-align: center;
}

.card-section > div:first-child {
    margin-bottom: 20px;
    min-height: 80px; /* 제목과 설명 영역 높이 고정 */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-section > div:last-child {
    margin-top: auto; /* 버튼 영역을 하단으로 밀어냄 */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.nav-button, #draw-button, .submit-button, #retry-button {
    background-color: var(--button-bg);
    color: var(--button-text);
    border: none;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    width: fit-content;
}

#result {
    font-size: 18px;
    font-weight: bold;
    min-height: 24px; /* 결과 텍스트 영역 높이 고정 */
    margin: 0;
}

.nav-header {
    text-align: left;
    margin-bottom: 20px;
}

.back-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.back-link:hover {
    opacity: 1;
}

.subtitle {
    font-size: 14px;
    opacity: 0.7;
    margin-bottom: 20px;
}

.upload-container {
    border: 2px dashed var(--text-color);
    border-radius: 15px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.3s;
    background-color: var(--bg-color);
    margin-bottom: 20px;
}

#loading-spinner {
    margin: 20px 0;
    font-weight: bold;
    color: var(--button-hover);
}

.bar-container {
    background-color: #eee;
    border-radius: 10px;
    height: 20px;
    width: 100%;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background-color: var(--button-bg);
    transition: width 0.5s ease-out;
}

.divider {
    border: 0;
    height: 1px;
    background: var(--text-color);
    opacity: 0.1;
    margin: 40px 0;
}

.contact-section {
    max-width: 500px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 15px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--shadow-color);
    border-radius: 5px;
    background-color: var(--bg-color);
    color: var(--text-color);
    box-sizing: border-box;
    font-family: inherit;
}

.form-group textarea {
    height: 80px;
    resize: none;
}
