/* 레이아웃 스타일 - 페이지 구조, 그리드, 컨테이너 등을 관리 */

/* 기본 레이아웃 구조 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 헤더 영역 */
.header {
    display: flex;
    flex-direction: column;
    padding: 15px 0;
    margin-bottom: 20px;
    position: relative;
}

.header .back-btn {
    position: absolute;
    top: 15px;
    left: 0;
    font-size: 1.2rem;
    color: #333;
    text-decoration: none;
}

.header h1 {
    text-align: center;
    margin: 10px 0 15px;
    font-size: 1.8rem;
}

.progress-container {
    margin-top: 10px;
}

/* 메인 콘텐츠 영역 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 80px; /* 하단 옵션 영역을 위한 공간 */
}

/* 카테고리 섹션 */
.category-section {    margin-bottom: 10px;    max-height: 200px;    overflow-y: auto;}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.category-container {
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.category-container.expanded {
    max-height: 1000px;
}

.category-columns {
    display: flex;
    gap: 15px;
}

.category-column {
    flex: 1;
}

.category-group {
    margin-bottom: 8px;
}

.grade-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

/* 제어 섹션 */
.control-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

/* 단어 학습 카드 섹션 */
.vocabulary-section {
    flex: 2;
    display: flex;
    flex-direction: column;
    margin-top: 20px;
    align-items: center;
}

.card-container {
    flex: 1;
    min-height: 550px;
    margin: 0 auto;
    margin-bottom: 10px;
    perspective: 1000px; /* 3D 효과를 위한 원근감 */
    max-width: 500px; /* 카드 최대 너비 제한 */
}

.navigation-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    width: 100%;
    max-width: 500px;
}

/* 카드 구조 */
.card {
    width: 100%;
    height: 100%;
    min-height: 550px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.card.flipped {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    min-height: 550px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 15px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.card-back {
    transform: rotateY(180deg);
}

.word-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
}

/* 학습 옵션 영역 */
.learning-options {
    display: flex;
    justify-content: space-around;
    padding: 15px 0;
    position: absolute;
    bottom: auto;
    top: 10px;
    left: 0;
    right: 0;
    background-color: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 200;
}

/* 완료 화면 */
.completion-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.completion-content {
    background-color: white;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.completion-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* 로딩/오류 화면 */
.loader, .error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

/* 반응형 레이아웃 */
@media (min-width: 768px) {
    .category-container {
        max-height: none;
        overflow: visible;
    }
    
    .category-toggle {
        display: none;
    }
    
    .category-group {
        margin-bottom: 20px;
    }
    
    .card-container {
        min-height: 500px;
    }
    
    .learning-options {
        position: static;
        box-shadow: none;
        margin-top: 20px;
    }
    
    .main-content {
        margin-bottom: 0;
    }
}

@media (max-width: 767px) {
    .category-header h2 {
        font-size: 1.2rem;
    }
    
    .grade-buttons {
        flex-wrap: wrap;
    }
    
    .grade-button {
        flex: 1 0 calc(33.333% - 10px);
        min-width: 60px;
    }
} 