/**
 * 카드 학습 모드 스타일
 */

/* 카드 학습 컨테이너 */
#cardLearningView {
    display: none;
    padding: 20px 0;
}

/* 진행률 표시 */
.card-progress-container {
    margin-bottom: 30px;
    text-align: center;
}

.card-progress-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.card-progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.card-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    transition: width 0.3s ease;
    border-radius: 10px;
}

/* 학습 카드 */
.learning-card {
    perspective: 1000px;
    width: 100%;
    max-width: 600px;
    height: 400px;
    margin: 0 auto 30px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.learning-card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    background: white;
}

.card-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.card-back {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    transform: rotateY(180deg);
}

.card-content {
    text-align: center;
    width: 100%;
}

.card-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.card-text {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.4;
    word-break: keep-all;
}

.card-sound-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.card-sound-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.card-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    opacity: 0.7;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 0.4; }
}

/* 카드 액션 버튼 */
.card-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
}

.card-actions button {
    flex: 1;
    max-width: 200px;
}

/* 학습 모드 토글 버튼 */
#learningModeToggle {
    margin-bottom: 20px;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .learning-card {
        height: 350px;
        max-width: 100%;
    }
    
    .card-text {
        font-size: 1.5rem;
    }
    
    .card-front,
    .card-back {
        padding: 30px 20px;
    }
    
    .card-sound-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .card-actions {
        flex-direction: column;
    }
    
    .card-actions button {
        max-width: 100%;
    }
}

/* 카테고리 선택 개선 */
.category-search {
    position: relative;
    margin-bottom: 20px;
}

.category-search input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.category-search input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.category-search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

/* 카테고리 그리드 */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.category-grid-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-grid-item:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.category-grid-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.category-grid-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.category-grid-name {
    font-size: 0.9rem;
    font-weight: 600;
}

/* 최근 학습 카테고리 */
.recent-categories {
    margin-bottom: 20px;
}

.recent-categories-title {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.recent-categories-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.recent-category-badge {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.recent-category-badge:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 학습 통계 */
.learning-stats {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.learning-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    text-align: center;
}

.stat-item {
    padding: 10px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .learning-stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}
