/* ============================================================
   Pintar Berbicara — Stylesheet
   Aplikasi Belajar Ngomong untuk Anak Balita
   ============================================================ */

/* ─── CSS Custom Properties ──────────────────────────────── */
:root {
    --kendaraan:       #FFCA28;
    --kendaraan-text:  #5d4037;
    --kendaraan-light: #FFF8E1;

    --hewan:           #66BB6A;
    --hewan-text:      #ffffff;
    --hewan-light:     #E8F5E9;

    --makanan:         #FF7043;
    --makanan-text:    #ffffff;
    --makanan-light:   #FBE9E7;

    --mainan:          #42A5F5;
    --mainan-text:     #ffffff;
    --mainan-light:    #E3F2FD;

    --font-main: 'Fredoka', cursive, sans-serif;
}

body {
    font-family: var(--font-main);
    background-color: #FFF9E6;
    min-height: 100vh;
}


/* ─── Halaman Utama ──────────────────────────────────────── */
.hero-title {
    font-size: 2.2rem;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.15rem;
}

.greeting-text {
    font-size: 1.3rem;
    font-weight: 600;
}


/* ─── Kartu Kategori (Index) ─────────────────────────────── */
.category-card {
    border: none;
    border-radius: 30px;
    color: white;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.15);
    text-decoration: none !important;
    position: relative;
    overflow: hidden;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 0 rgba(0, 0, 0, 0.15);
}

.category-card:active {
    transform: scale(0.95) translateY(2px);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
    animation: wiggle 0.4s ease;
}

.category-card .card-icon {
    font-size: 4.5rem;
    line-height: 1;
}

.category-card .card-title-custom {
    font-size: 1.8rem;
    font-weight: 600;
}

.category-card .card-count {
    font-size: 0.95rem;
    opacity: 0.85;
    font-weight: 400;
}

.category-card .card-desc {
    font-size: 0.85rem;
    opacity: 0.75;
    font-weight: 400;
    font-style: italic;
}

/* Warna kategori */
.bg-kendaraan { background-color: var(--kendaraan); color: var(--kendaraan-text) !important; }
.bg-hewan     { background-color: var(--hewan);     color: var(--hewan-text)     !important; }
.bg-makanan   { background-color: var(--makanan);    color: var(--makanan-text)   !important; }
.bg-mainan    { background-color: var(--mainan);     color: var(--mainan-text)    !important; }

/* Background play page per kategori */
.bg-play-kendaraan { background-color: var(--kendaraan-light); }
.bg-play-hewan     { background-color: var(--hewan-light);     }
.bg-play-makanan   { background-color: var(--makanan-light);   }
.bg-play-mainan    { background-color: var(--mainan-light);    }


/* ─── Halaman Play ───────────────────────────────────────── */
.play-header {
    font-size: 1.8rem;
    font-weight: 700;
}

.play-counter {
    font-size: 0.9rem;
}

.btn-back {
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem 1.5rem;
}

.btn-speak-all {
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem 1.5rem;
}


/* ─── Kartu Item (Play) ─────────────────────────────────── */
.item-card {
    border: none;
    border-radius: 25px;
    background: white;
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.08);
    transition: transform 0.15s ease,
                background-color 0.2s ease,
                box-shadow 0.15s ease;
    cursor: pointer;
    position: relative;
}

.item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 9px 0 rgba(0, 0, 0, 0.1);
}

.item-card:active {
    transform: scale(0.92);
    background-color: #FFFDE7;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.08);
}

/* Highlight saat sedang diucapkan */
.item-card.active-speak {
    background-color: #FFFDE7;
    box-shadow: 0 0 0 4px rgba(255, 193, 7, 0.5),
                0 6px 0 rgba(0, 0, 0, 0.08);
}

.item-emoji {
    font-size: 3.5rem;
    line-height: 1;
}

.item-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: #333;
}

.item-desc {
    font-size: 0.72rem;
    color: #999;
    font-weight: 400;
    line-height: 1.3;
}

.item-sound {
    font-size: 0.78rem;
    color: #bbb;
    font-style: italic;
}


/* ─── Speech Bubble (Fixed Bottom) ───────────────────────── */
.speech-bubble-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    pointer-events: none;
    display: none;
}

.speech-bubble {
    background: linear-gradient(135deg, #333, #555);
    color: white;
    padding: 14px 28px;
    border-radius: 24px;
    font-size: 1.15rem;
    font-weight: 600;
    font-family: var(--font-main);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    animation: bubbleFadeIn 0.3s ease;
    white-space: nowrap;
    max-width: 90vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

.speech-bubble.hiding {
    animation: bubbleFadeOut 0.3s ease forwards;
}


/* ─── Halaman 404 ────────────────────────────────────────── */
.error-emoji {
    font-size: 6rem;
    line-height: 1;
}

.error-title {
    font-size: 2rem;
    font-weight: 700;
}


/* ─── Footer ─────────────────────────────────────────────── */
.app-footer {
    font-size: 0.85rem;
    color: #bbb;
    padding: 2.5rem 0 1.5rem;
}


/* ─── Animasi ────────────────────────────────────────────── */
@keyframes bounce {
    0%, 100% { transform: scale(1); }
    30%      { transform: scale(1.08); }
    50%      { transform: scale(0.95); }
    70%      { transform: scale(1.03); }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    20%      { transform: rotate(-3deg); }
    40%      { transform: rotate(3deg); }
    60%      { transform: rotate(-2deg); }
    80%      { transform: rotate(2deg); }
}

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

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

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

.animate-bounce {
    animation: bounce 0.5s ease;
}

.animate-wiggle {
    animation: wiggle 0.4s ease;
}

.fade-in-up {
    animation: fadeInUp 0.4s ease both;
}

/* Stagger animation — kartu muncul berurutan */
.fade-in-up:nth-child(1)  { animation-delay: 0.00s; }
.fade-in-up:nth-child(2)  { animation-delay: 0.05s; }
.fade-in-up:nth-child(3)  { animation-delay: 0.10s; }
.fade-in-up:nth-child(4)  { animation-delay: 0.15s; }
.fade-in-up:nth-child(5)  { animation-delay: 0.20s; }
.fade-in-up:nth-child(6)  { animation-delay: 0.25s; }
.fade-in-up:nth-child(7)  { animation-delay: 0.30s; }
.fade-in-up:nth-child(8)  { animation-delay: 0.35s; }
.fade-in-up:nth-child(9)  { animation-delay: 0.40s; }
.fade-in-up:nth-child(10) { animation-delay: 0.45s; }
.fade-in-up:nth-child(11) { animation-delay: 0.50s; }
.fade-in-up:nth-child(12) { animation-delay: 0.55s; }


/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 576px) {
    .hero-title                    { font-size: 1.6rem; }
    .greeting-text                 { font-size: 1.1rem; }
    .category-card .card-icon      { font-size: 3.5rem; }
    .category-card .card-title-custom { font-size: 1.4rem; }
    .item-emoji                    { font-size: 2.8rem; }
    .item-name                     { font-size: 1rem; }
    .play-header                   { font-size: 1.4rem; }
    .speech-bubble                 { font-size: 1rem; padding: 10px 20px; }
}
