/* =========================================
   WordLearning3100 - Styles V2 (Dashboard / Auth)
========================================= */

:root {
    --cyan: #22d3ee;
    --purple: #c084fc;
    --green: #4ade80;
    --amber: #fbbf24;
    --red: #f87171;
    --pink: #f472b6;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    overflow-x: hidden;
    background: #0f172a;
    /* slate-900 */
    color: #f8fafc;
}

/* Background Canvas */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* Glass Panels */
.glass-panel {
    background: rgba(30, 41, 59, 0.4);
    /* slate-800 with opacity */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

.bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes toastSlide {
    0% {
        transform: translateY(100%) translateX(-50%);
        opacity: 0;
    }

    15% {
        transform: translateY(0) translateX(-50%);
        opacity: 1;
    }

    85% {
        transform: translateY(0) translateX(-50%);
        opacity: 1;
    }

    100% {
        transform: translateY(100%) translateX(-50%);
        opacity: 0;
    }
}

.animate-toast {
    animation: toastSlide 2.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    position: absolute;
    left: 50%;
    bottom: 2rem;
}

.toast-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    pointer-events: none;
    z-index: 1000;
}

/* Base Buttons */
.action-btn {
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    color: white;
    font-weight: bold;
    padding: 0.75rem 1.5rem;
    border-radius: 1rem;
    transition: all 0.2s;
    border: none;
    box-shadow: 0 4px 15px rgba(34, 211, 238, 0.15);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34, 211, 238, 0.3);
}

/* Section Hiding */
.hidden {
    display: none !important;
}

/* Flashcard Styles */
.flashcard-container {
    perspective: 1000px;
    margin: 0 auto;
    width: 100%;
    max-width: 480px;
}

.flashcard-wrapper {
    width: 100%;
    height: 320px;
    position: relative;
    cursor: pointer;
}

.flashcard {
    width: 100%;
    height: 100%;
    position: absolute;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    border-radius: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.flashcard.flipped {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 2rem;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    text-align: center;
}

.flashcard-back {
    transform: rotateY(180deg);
    background: rgba(45, 27, 78, 0.8);
    border-color: rgba(192, 132, 252, 0.3);
}

.fc-word {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--cyan);
    margin-bottom: 0.5rem;
}

.fc-chinese {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--purple);
    margin-bottom: 0.5rem;
}

.fc-pos {
    color: var(--amber);
    font-size: 1.25rem;
    font-weight: 600;
}

.fc-hint {
    position: absolute;
    bottom: 20px;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    opacity: 0.6;
}

.fc-btn {
    padding: 1rem 2rem;
    border-radius: 1rem;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.fc-btn-unknown {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
    border-color: rgba(239, 68, 68, 0.3);
}

.fc-btn-unknown:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.05);
}

.fc-btn-known {
    background: rgba(34, 197, 94, 0.1);
    color: var(--green);
    border-color: rgba(34, 197, 94, 0.3);
}

.fc-btn-known:hover {
    background: rgba(34, 197, 94, 0.2);
    transform: scale(1.05);
}

/* General Layout helpers */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Mastered state overrides */
.vocab-card.mastered h3 {
    color: var(--green) !important;
}

/* Speak / Pronunciation Buttons */
.speak-icon-btn {
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.2);
    color: var(--cyan);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.speak-icon-btn:hover {
    background: rgba(34, 211, 238, 0.2);
    transform: scale(1.1);
}

.speak-btn {
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.25);
    color: var(--cyan);
    border-radius: 0.75rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.speak-btn:hover {
    background: rgba(34, 211, 238, 0.2);
    transform: translateY(-1px);
}