/* Main styles for Chiki Learning Adventure */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

body {
    font-family: 'Nunito', sans-serif;
}

/* Color variables based on Chiki palette */
:root {
    --chiki-yellow: #F6EB61;
    --chiki-red: #E74C3C;
    --chiki-brown: #A0522D;
    --sky-blue: #87CEEB;
    --light-blue: #E0F4FF;
    --text-dark: #333333;
    --text-light: #666666;
    --success-green: #90EE90;
    --error-red: #FFB6C1;
    --star-gold: #FFD700;
}

/* Typography */
h1 {
    font-size: 48px;
    font-weight: 800;
    color: var(--text-dark);
    text-align: center;
}

h2 {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-dark);
}

h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
}

p {
    font-size: 18px;
    color: var(--text-light);
}

/* Buttons */
.btn {
    padding: 16px 32px;
    font-size: 20px;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Nunito', sans-serif;
}

.btn-primary {
    background: var(--chiki-red);
    color: white;
    box-shadow: 0 4px 0 #C0392B;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #C0392B;
}

.btn-primary:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #C0392B;
}

.btn-secondary {
    background: white;
    color: var(--text-dark);
    border: 3px solid var(--chiki-brown);
    box-shadow: 0 4px 0 #8B4513;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #8B4513;
}

/* Cards */
.card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Letter display */
.letter-card {
    width: 150px;
    height: 180px;
    background: white;
    border: 4px solid var(--chiki-brown);
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 96px;
    font-weight: 800;
    color: var(--text-dark);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Word display */
.word-display {
    font-size: 72px;
    font-weight: 800;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 8px;
}

/* Image display for word modes */
.object-image {
    max-width: 300px;
    max-height: 300px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

/* Menu styles */
.menu-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
    padding: 20px;
    width: 100%;
}

.adventure-list {
    width: 100%;
    max-height: 380px;
    overflow-y: auto;
}

/* Table-like adventure list */
.adventure-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.adventure-table thead {
    background: #f5f5f5;
}

.adventure-table th {
    padding: 10px 15px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    border-bottom: 2px solid #e0e0e0;
}

.adventure-table th:last-child {
    text-align: right;
}

.adventure-row {
    cursor: pointer;
    transition: background 0.15s ease;
}

.adventure-row:hover {
    background: #FFF9E6;
}

.adventure-row td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    font-size: 15px;
}

.adventure-name {
    font-weight: 600;
    color: #333;
}

.adventure-mode {
    color: #666;
    font-size: 13px;
}

.adventure-plays {
    color: #888;
    font-size: 13px;
}

.adventure-actions {
    text-align: right;
    white-space: nowrap;
}

.btn-play-small {
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    background: var(--chiki-yellow);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-play-small:hover {
    background: #e6d44f;
    transform: scale(1.05);
}

.btn-delete-small {
    background: none;
    border: none;
    font-size: 20px;
    color: #ccc;
    cursor: pointer;
    padding: 0 8px;
    margin-left: 8px;
    transition: color 0.15s ease;
}

.btn-delete-small:hover {
    color: #e74c3c;
}

/* Mode selection - horizontal layout */
.mode-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.mode-section h3 {
    font-size: 16px;
    margin: 0;
    color: var(--text-light);
}

.mode-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
}

.mode-card {
    background: white;
    border: 3px solid #ddd;
    border-radius: 12px;
    padding: 12px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    flex: 0 0 auto;
}

.mode-card:hover {
    border-color: var(--chiki-yellow);
    transform: scale(1.02);
}

.mode-card.selected {
    border-color: var(--chiki-red);
    background: #FFF5F5;
}

.mode-card .mode-icon {
    font-size: 28px;
    margin-bottom: 4px;
}

.mode-card .mode-name {
    font-size: 13px;
    font-weight: 700;
}

.mode-card .mode-desc {
    font-size: 10px;
    color: var(--text-light);
    margin-top: 2px;
}

/* Setup page horizontal layout */
.setup-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 20px;
}

.setup-container h2 {
    font-size: 28px;
    margin-bottom: 15px;
}

/* Tutorial specific styles */
.tutorial-quadrant {
    width: 45%;
    height: 45%;
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.tutorial-quadrant.active {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255,255,255,0.5);
}

.door {
    width: 120px;
    height: 200px;
    background: linear-gradient(180deg, #8B4513 0%, #654321 100%);
    border-radius: 8px 8px 0 0;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.door.open {
    transform: perspective(400px) rotateY(-80deg);
}

.door-handle {
    position: absolute;
    right: 15px;
    top: 50%;
    width: 12px;
    height: 12px;
    background: #FFD700;
    border-radius: 50%;
}

.stepping-stone {
    width: 80px;
    height: 40px;
    background: linear-gradient(180deg, #888 0%, #666 100%);
    border-radius: 40px;
    transition: all 0.2s ease;
}

.stepping-stone.active {
    background: linear-gradient(180deg, #90EE90 0%, #32CD32 100%);
}

.stepping-stone.wrong {
    animation: wobble 0.5s ease;
}

@keyframes wobble {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

/* Celebration effects */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--star-gold);
    animation: fall 3s ease-out forwards;
}

@keyframes fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Loading indicator */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #ddd;
    border-top-color: var(--chiki-yellow);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Transitions */
.fade-enter {
    opacity: 0;
}

.fade-enter-active {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.fade-exit {
    opacity: 1;
}

.fade-exit-active {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Answer button animations */
.answer-btn {
    transition: all 0.2s ease, transform 0.1s ease;
    animation: slideUp 0.3s ease backwards;
}

.answer-btn:nth-child(1) { animation-delay: 0.1s; }
.answer-btn:nth-child(2) { animation-delay: 0.15s; }
.answer-btn:nth-child(3) { animation-delay: 0.2s; }
.answer-btn:nth-child(4) { animation-delay: 0.25s; }

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.answer-btn:active:not(.disabled) {
    transform: scale(0.95);
}

.answer-btn.correct {
    animation: correctPulse 0.5s ease;
    background: linear-gradient(135deg, #90EE90 0%, #32CD32 100%);
    border-color: #228B22;
}

.answer-btn.incorrect {
    animation: wrongShake 0.4s ease;
    background: linear-gradient(135deg, #FFB6C1 0%, #FF6B6B 100%);
    border-color: #E74C3C;
}

.answer-btn.highlight {
    animation: highlightPulse 1s ease infinite;
    box-shadow: 0 0 20px rgba(246, 235, 97, 0.8);
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

@keyframes highlightPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(246, 235, 97, 0.8);
        border-color: var(--chiki-yellow);
    }
    50% {
        box-shadow: 0 0 40px rgba(246, 235, 97, 1);
        border-color: var(--star-gold);
    }
}

/* Content entrance animation */
.content-entrance {
    animation: contentFadeIn 0.4s ease backwards;
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Star collection effect */
.star-collect {
    animation: starBurst 0.6s ease forwards;
}

@keyframes starBurst {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.5);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Chiki entrance animation */
#chiki-image {
    transition: opacity 0.2s ease, transform 0.3s ease;
}

#chiki-image:hover {
    transform: scale(1.02);
}

/* Progress bucket fill animation */
#bucket-fill {
    transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Letter card hover effect */
.letter-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

/* Image pop-in effect */
.target-image, .object-image {
    animation: imagePop 0.4s ease backwards;
    animation-delay: 0.2s;
}

@keyframes imagePop {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Celebration sparkle effect */
@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.sparkle {
    animation: sparkle 0.5s ease infinite;
}
