/* WordFlow 귀여운 디자인 CSS */

/* 기본 애니메이션들 */
@keyframes bounceGentle {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-3px); }
}

@keyframes floating {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes sparkle {
    0% { opacity: 0; transform: scale(0) rotate(0deg); }
    50% { opacity: 1; transform: scale(1) rotate(180deg); }
    100% { opacity: 0; transform: scale(0) rotate(360deg); }
}

@keyframes rainbow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulse-cute {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes wiggle {
    0%, 7%, 100% { transform: rotate(0deg); }
    15% { transform: rotate(-5deg); }
    20% { transform: rotate(5deg); }
    25% { transform: rotate(-5deg); }
    30% { transform: rotate(5deg); }
    35% { transform: rotate(-2deg); }
}

/* 유틸리티 클래스들 */
.bounce-gentle { animation: bounceGentle 2s ease-in-out infinite; }
.floating { animation: floating 3s ease-in-out infinite; }
.sparkle { animation: sparkle 1.5s linear infinite; }
.pulse-cute { animation: pulse-cute 2s ease-in-out infinite; }
.wiggle { animation: wiggle 1s ease-in-out; }

.cute-shadow {
    box-shadow: 0 8px 32px rgba(255, 105, 135, 0.3);
}

.cute-shadow-lg {
    box-shadow: 0 12px 48px rgba(255, 105, 135, 0.4);
}

.rainbow-bg { 
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 25%, #fecfef 75%, #ff9a9e 100%);
    background-size: 400% 400%;
    animation: rainbow 4s ease infinite;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 카드 호버 효과들 */
.card-hover { 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover { 
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(255, 105, 135, 0.4);
}

.card-float {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-float:hover {
    transform: translateY(-10px) rotate(2deg);
}

/* 버튼 스타일들 */
.btn-cute {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 154, 158, 0.4);
}

.btn-cute:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 154, 158, 0.6);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #8b4513;
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa8a8 100%);
}

/* 플래시카드 효과 */
.flashcard {
    perspective: 1000px;
    min-height: 200px;
}

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

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

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.flashcard-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

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

/* 퀴즈 옵션 스타일 */
.quiz-option {
    transition: all 0.3s ease;
    border-radius: 15px;
    padding: 15px 20px;
    cursor: pointer;
    border: 2px solid transparent;
}

.quiz-option:hover {
    transform: translateX(5px);
    border-color: #ff9a9e;
    background: linear-gradient(135deg, #ffeef8 0%, #f8f9ff 100%);
}

.quiz-option.selected {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    color: white;
    transform: scale(1.02);
}

.quiz-option.correct {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    animation: pulse-cute 0.5s;
}

.quiz-option.incorrect {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa8a8 100%);
    color: white;
    animation: wiggle 0.5s;
}

/* 진도바 스타일 */
.progress-bar {
    height: 12px;
    background: linear-gradient(90deg, #ffe5e5, #f0f0f0);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff9a9e, #fad0c4, #a8edea);
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-fill::after {
    content: '✨';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    animation: sparkle 2s linear infinite;
}

/* 뱃지 스타일 */
.badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.badge-new {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    color: white;
    animation: pulse-cute 2s infinite;
}

.badge-master {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #8b6f00;
}

.badge-streak {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa8a8 100%);
    color: white;
}

.badge-perfect {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #2c5aa0;
}

/* 게임 요소들 */
.game-tile {
    background: white;
    border: 3px solid #ff9a9e;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.game-tile:hover {
    background: linear-gradient(135deg, #ffeef8 0%, #f8f9ff 100%);
    transform: scale(1.05) rotate(1deg);
}

.game-tile.selected {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    color: white;
    border-color: #ff6b6b;
    transform: scale(1.1);
}

.game-tile.correct {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    animation: bounceGentle 1s;
}

.game-tile.incorrect {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa8a8 100%);
    color: white;
    animation: wiggle 0.5s;
}

/* 모달 애니메이션 */
.modal-enter {
    animation: modalSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 귀여운 로딩 애니메이션 */
.loading-cute {
    display: inline-block;
}

.loading-cute::after {
    content: '✨';
    animation: sparkle 1s linear infinite;
}

/* 토스트 메시지 스타일 */
.toast {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 25px;
    padding: 12px 20px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4);
    animation: toastSlideIn 0.3s ease;
}

.toast.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.toast.error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa8a8 100%);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 단원 카드 스타일 */
.unit-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.unit-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff9a9e, #fad0c4, #a8edea);
}

.unit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(255, 154, 158, 0.3);
    border-color: #ff9a9e;
}

.unit-card .unit-emoji {
    font-size: 3rem;
    margin-bottom: 12px;
    display: block;
    text-align: center;
    animation: floating 3s ease-in-out infinite;
}

.unit-card .unit-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 8px;
    text-align: center;
}

.unit-card .unit-description {
    color: #718096;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 16px;
}

.unit-card .unit-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 16px;
}

.unit-stat {
    text-align: center;
    padding: 8px;
    background: linear-gradient(135deg, #ffeef8 0%, #f8f9ff 100%);
    border-radius: 10px;
}

.unit-stat .stat-number {
    font-weight: bold;
    font-size: 1.1rem;
    color: #4a5568;
}

.unit-stat .stat-label {
    font-size: 0.75rem;
    color: #718096;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .card-hover:hover {
        transform: translateY(-4px) scale(1.01);
    }
    
    .flashcard-front, .flashcard-back {
        padding: 20px;
    }
    
    .unit-card {
        padding: 16px;
    }
    
    .unit-card .unit-emoji {
        font-size: 2.5rem;
    }
}

/* 스크롤바 커스터마이징 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa8a8 100%);
}

/* 선택 텍스트 색상 */
::selection {
    background: rgba(255, 154, 158, 0.3);
    color: #2d3748;
}

::-moz-selection {
    background: rgba(255, 154, 158, 0.3);
    color: #2d3748;
}