/* Space Academy - Unified Styling */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0c0c2e 0%, #1a1a3e 50%, #2d1b69 100%);
    min-height: 100vh;
    color: white;
    overflow-x: hidden;
    transition: all 0.3s ease;
}

/* Page Transition Animations */
.page-enter {
    animation: pageEnter 0.6s ease-out forwards;
}

.page-exit {
    animation: pageExit 0.4s ease-in forwards;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pageExit {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-30px) scale(1.05);
    }
}

/* Loading Animation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0c0c2e 0%, #1a1a3e 50%, #2d1b69 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #4facfe;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animated Stars Background */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 160px 30px, #ddd, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: sparkle 20s linear infinite;
}

@keyframes sparkle {
    from { transform: translateY(0px); }
    to { transform: translateY(-100px); }
}

/* Welcome Page Styles */
.welcome-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.welcome-container {
    text-align: center;
    position: relative;
    z-index: 10;
}

.academy-logo h1 {
    font-size: 4rem;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 20px rgba(255, 255, 255, 0.5); }
    to { text-shadow: 0 0 30px rgba(255, 255, 255, 0.8), 0 0 40px rgba(100, 200, 255, 0.6); }
}

.tagline {
    font-size: 1.2rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

.welcome-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    margin: 0 auto;
}

.welcome-card h2 {
    margin-bottom: 15px;
    color: #64b5f6;
}

.name-input-container {
    margin-top: 30px;
}

#studentName {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    margin-bottom: 20px;
    text-align: center;
}

#studentName::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#launchBtn {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: none;
    border-radius: 25px;
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

#launchBtn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 35px rgba(79, 172, 254, 0.5);
    background: linear-gradient(135deg, #64b5f6 0%, #42a5f5 100%);
}

#launchBtn:active {
    transform: translateY(-2px) scale(1.02);
    transition: transform 0.1s ease;
}

/* Floating Elements */
.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.planet {
    position: absolute;
    font-size: 3rem;
    animation: float 6s ease-in-out infinite;
}

.planet-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.planet-2 {
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.planet-3 {
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Header Styles */
.academy-header {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 1.8rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.astronaut-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Menu Page Styles */
.mission-control {
    max-width: 800px;
    margin: 50px auto;
    padding: 0 20px;
    text-align: center;
}

.mission-control h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #64b5f6;
}

.mission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 50px 0;
}

.mission-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px 30px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.mission-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 25px 50px rgba(79, 172, 254, 0.3);
    border-color: #4facfe;
    background: rgba(79, 172, 254, 0.1);
}

.mission-card:active {
    transform: translateY(-5px) scale(0.98);
    transition: transform 0.1s ease;
}

.mission-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.mission-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #64b5f6;
}

.mission-status {
    margin-top: 20px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Challenges Page */
.challenges-container {
    max-width: 1000px;
    margin: 50px auto;
    padding: 0 20px;
    text-align: center;
}

.challenges-container h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #64b5f6;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin: 50px 0;
}

.game-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px 30px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    position: relative;
}

.game-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 25px 50px rgba(79, 172, 254, 0.2);
    border-color: #64b5f6;
    background: rgba(100, 181, 246, 0.1);
}

.game-card:active {
    transform: translateY(-5px) scale(0.98);
    transition: transform 0.1s ease;
}

.game-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.game-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #64b5f6;
}

.game-status.coming-soon {
    margin-top: 20px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.9rem;
    color: #333;
}

.game-status.ready {
    margin-top: 20px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.9rem;
    color: white;
}

/* Coming Soon Pages */
.coming-soon-container {
    max-width: 600px;
    margin: 50px auto;
    padding: 0 20px;
}

.coming-soon-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
}

.preview-icon {
    font-size: 3rem;
    margin: 20px 0;
}

.features-preview {
    margin: 30px 0;
    text-align: left;
}

.features-preview ul {
    list-style: none;
    padding: 0;
}

.features-preview li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.coming-soon-badge {
    background: rgba(255, 154, 158, 0.2);
    border: 2px solid #ff9a9e;
    border-radius: 15px;
    padding: 20px;
    margin: 30px 0;
}

/* AI Tutor (Chatbot) Styles */
.container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    overflow: hidden;
}

.lesson-title {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lesson-title h2 {
    color: #64b5f6;
    margin-bottom: 10px;
}

.chat-container {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: rgba(0, 0, 0, 0.1);
}

.message {
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease-in;
}

.bot-message .message-content {
    background: rgba(100, 181, 246, 0.2);
    border: 2px solid #64b5f6;
    border-radius: 15px 15px 15px 5px;
    padding: 12px 16px;
    display: inline-block;
    max-width: 80%;
}

.user-message .message-content {
    background: rgba(67, 233, 123, 0.2);
    border: 2px solid #43e97b;
    border-radius: 15px 15px 5px 15px;
    padding: 12px 16px;
    display: inline-block;
    max-width: 80%;
    margin-left: auto;
    text-align: right;
}

.user-message {
    text-align: right;
}

.bot-name {
    font-weight: bold;
    color: #64b5f6;
}

.user-name {
    font-weight: bold;
    color: #43e97b;
}

/* Quick Actions Buttons */
.quick-actions {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 140px;
    text-align: center;
}

.action-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #7c8ff0 0%, #8a5fb8 100%);
}

.action-btn:active {
    transform: translateY(0) scale(1.02);
    transition: transform 0.1s ease;
}

.input-container {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
}

#messageInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    outline: none;
}

#messageInput::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#sendBtn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: none;
    border-radius: 25px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

#sendBtn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(79, 172, 254, 0.5);
    background: linear-gradient(135deg, #64b5f6 0%, #42a5f5 100%);
}

#sendBtn:active:not(:disabled) {
    transform: translateY(-1px) scale(1.02);
    transition: transform 0.1s ease;
}

.status-container {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
}

.typing-indicator {
    display: flex;
    gap: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4facfe;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Back Button */
.back-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.1);
}

.back-btn:active {
    transform: translateY(-1px) scale(1.02);
    transition: transform 0.1s ease;
}

/* Math Shooter Game Styles */
.game-container {
    max-width: 900px;
    margin: 20px auto;
    padding: 0 20px;
}

/* Question Display */
.question-display {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.current-question {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.game-ui {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ui-label {
    color: rgba(255, 255, 255, 0.8);
    margin-right: 10px;
}

.ui-value {
    color: #4facfe;
    font-weight: bold;
    font-size: 1.2rem;
}

#gameCanvas {
    width: 100%;
    max-width: 700px;
    height: 500px;
    border: 2px solid #4facfe;
    border-radius: 10px;
    background: linear-gradient(180deg, #0c0c2e 0%, #1a1a3e 100%);
    display: block;
    margin: 0 auto;
}

.game-controls {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.answer-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.answer-section label {
    color: white;
    font-weight: bold;
    min-width: 60px;
}

#answerInput, #bossAnswer {
    flex: 1;
    max-width: 200px;
    padding: 10px 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    text-align: center;
}

#answerInput:focus, #bossAnswer:focus {
    border-color: #4facfe;
    outline: none;
    box-shadow: 0 0 10px rgba(79, 172, 254, 0.3);
}

.game-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.game-btn.primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.game-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.game-status {
    text-align: center;
    color: #64b5f6;
    font-size: 1.1rem;
    font-weight: bold;
}

.game-instructions {
    text-align: center;
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    background: rgba(79, 172, 254, 0.2);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(79, 172, 254, 0.3);
}

.instructions-title {
    color: #4facfe;
    font-size: 1.1rem;
    font-weight: bold;
    margin: 0 0 8px 0;
    text-align: center;
}

.instructions-text {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

.game-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    border: 2px solid #4facfe;
    backdrop-filter: blur(10px);
}

.game-menu .game-btn {
    display: block;
    width: 200px;
    margin: 15px auto;
    padding: 15px 20px;
    font-size: 16px;
}

/* Boss Encounter Overlay */
.boss-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.boss-content {
    background: linear-gradient(135deg, #1a1a3e 0%, #2d1b69 100%);
    padding: 40px;
    border-radius: 20px;
    border: 3px solid #ff6b6b;
    max-width: 600px;
    text-align: center;
    animation: bossAppear 0.5s ease-out;
}

@keyframes bossAppear {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.boss-content h2 {
    color: #ff6b6b;
    margin-bottom: 20px;
    font-size: 2rem;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.boss-story {
    background: rgba(255, 107, 107, 0.1);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.5;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.boss-problem {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #ffff00;
    border: 2px solid rgba(255, 255, 0, 0.5);
}

.boss-controls {
    text-align: center;
}

.boss-answers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.boss-answer-btn {
    padding: 15px 20px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.boss-answer-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(79, 172, 254, 0.4);
    border-color: #ffffff;
}

.boss-instruction {
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

/* Game Over Screen */
.game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.game-over-content {
    background: linear-gradient(135deg, #0c0c2e 0%, #1a1a3e 100%);
    padding: 40px;
    border-radius: 20px;
    border: 2px solid #4facfe;
    text-align: center;
    max-width: 500px;
}

.game-over-content h2 {
    color: #4facfe;
    margin-bottom: 30px;
    font-size: 2rem;
}

.final-stats {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.final-stats p {
    margin: 10px 0;
    font-size: 1.1rem;
}

.final-stats span {
    color: #4facfe;
    font-weight: bold;
}

.game-over-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.game-over-buttons .game-btn {
    min-width: 150px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .academy-logo h1 {
        font-size: 2.5rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .mission-grid, .games-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        margin: 10px;
    }
    
    #gameCanvas {
        width: 100%;
        height: 400px;
    }
    
    .answer-section {
        flex-direction: column;
        gap: 10px;
    }
    
    .boss-content, .game-over-content {
        margin: 20px;
        padding: 20px;
    }
    
    .boss-controls, .game-over-buttons {
        flex-direction: column;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Pulse Animation for Important Elements */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Shake Animation for Errors */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Bounce Animation for Success */
.bounce {
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Glow Effect for Active Elements */
.glow {
    box-shadow: 0 0 20px rgba(79, 172, 254, 0.6);
    animation: glow-pulse 2s infinite alternate;
}

@keyframes glow-pulse {
    from { box-shadow: 0 0 20px rgba(79, 172, 254, 0.6); }
    to { box-shadow: 0 0 30px rgba(79, 172, 254, 0.8); }
}

/* Slide In Animations */
.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInLeft {
    from { transform: translateX(-100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Typing Indicator Enhancement */
.typing-indicator span {
    animation: typing 1.4s infinite ease-in-out, glow-dot 2s infinite alternate;
}

@keyframes glow-dot {
    from { box-shadow: 0 0 5px rgba(79, 172, 254, 0.5); }
    to { box-shadow: 0 0 10px rgba(79, 172, 254, 0.8); }
}

/* Enhanced Input Focus */
#messageInput:focus, #studentName:focus {
    border-color: #4facfe;
    box-shadow: 0 0 15px rgba(79, 172, 254, 0.4);
    transform: scale(1.02);
}

/* Smooth Transitions for All Interactive Elements */
button, .mission-card, .game-card, .back-btn, input, .welcome-card, .coming-soon-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stagger Animation for Grid Items */
.mission-grid .mission-card:nth-child(1) {
    animation-delay: 0.1s;
}

.mission-grid .mission-card:nth-child(2) {
    animation-delay: 0.2s;
}

.games-grid .game-card:nth-child(1) {
    animation-delay: 0.1s;
}

.games-grid .game-card:nth-child(2) {
    animation-delay: 0.2s;
}
/* Achie
vements Button */
.achievements-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    border-radius: 20px;
    color: white;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.achievements-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 15px rgba(240, 147, 251, 0.4);
    background: linear-gradient(135deg, #f5a3ff 0%, #f7677c 100%);
}

.achievements-btn:active {
    transform: translateY(0) scale(1.02);
    transition: transform 0.1s ease;
}

/* Achievements Page */
.achievements-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: calc(100vh - 120px);
}

.achievements-header {
    text-align: center;
    margin-bottom: 40px;
}

.achievements-header h2 {
    font-size: 2.5rem;
    color: #4facfe;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(79, 172, 254, 0.5);
}

.achievements-header p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.achievement-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 30px;
    border: 2px solid rgba(79, 172, 254, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.achievement-card.active {
    border-color: #4facfe;
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.2);
}

.achievement-card.coming-soon {
    border-color: rgba(255, 255, 255, 0.2);
    opacity: 0.7;
}

.achievement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(79, 172, 254, 0.3);
}

.achievement-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 20px;
}

.achievement-content h3 {
    color: #4facfe;
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
}

.achievement-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.stat-value {
    color: #43e97b;
    font-weight: bold;
    font-size: 1.1rem;
}

.achievement-progress {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #43e97b 0%, #38f9d7 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

.coming-soon-content {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

.coming-soon-content p:first-child {
    font-size: 1.2rem;
    color: #ff9800;
    margin-bottom: 10px;
}

.achievements-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.reset-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    border: none;
    border-radius: 25px;
    color: white;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.reset-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 15px rgba(255, 107, 107, 0.4);
}

.back-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 25px;
    color: white;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.back-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .achievements-grid {
        grid-template-columns: 1fr;
    }
    
    .achievement-stats {
        grid-template-columns: 1fr;
    }
    
    .achievements-actions {
        flex-direction: column;
        align-items: center;
    }
}