/* kid_features.css */
/* Styles for new educational features */

.game-icon.space {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: white;
}

.game-icon.canvas {
    background: linear-gradient(135deg, #fce7f3, #ec4899);
    color: white;
}

.modal-feature {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-feature.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content-feature {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border-radius: 30px;
    padding: 2rem;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    color: white;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-header-feature {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header-feature h2 {
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.close-feature-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-feature-btn:hover {
    background: #ef4444;
    transform: rotate(90deg);
}

/* Space Explorer Styles */
.space-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.space-image-container {
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    background: #000;
}

.space-image-container img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    display: block;
}

.space-title {
    font-size: 1.5rem;
    color: #fbbf24;
    text-align: center;
    font-weight: 700;
}

.space-description {
    font-size: 1.1rem;
    line-height: 1.6;
    text-align: justify;
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 15px;
}

.loader {
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top: 5px solid #fbbf24;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Canvas Styles */
.canvas-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#kids-canvas {
    display: block;
    cursor: crosshair;
    background: white;
    width: 100%;
}

.canvas-tools {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 15px;
}

.color-picker-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-swatch {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-swatch:hover,
.color-swatch.active {
    transform: scale(1.2);
    border-color: white;
}

.tool-btn {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: none;
    background: #3b82f6;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.tool-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

.tool-btn.clear {
    background: #ef4444;
}

.tool-btn.clear:hover {
    background: #dc2626;
}

/* AI Coder Styles */
.game-icon.coder {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.coder-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.coder-input {
    width: 100%;
    padding: 1rem;
    border-radius: 15px;
    border: 2px solid #3b82f6;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.1rem;
    font-family: inherit;
    resize: none;
    outline: none;
}

.coder-input:focus {
    border-color: #fbbf24;
}

.coder-canvas-wrapper {
    width: 100%;
    height: 350px;
    background: #0f172a;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.coder-star {
    position: absolute;
    font-size: 2rem;
    animation: fall 2s linear forwards;
}

@keyframes fall {
    from {
        transform: translateY(-50px) rotate(0deg);
        opacity: 1;
    }

    to {
        transform: translateY(400px) rotate(360deg);
        opacity: 0;
    }
}

.coder-ball {
    width: 50px;
    height: 50px;
    background: #3b82f6;
    border-radius: 50%;
    position: absolute;
    animation: bounceX 2s infinite alternate ease-in-out, bounceY 1s infinite alternate cubic-bezier(0.5, 0.05, 1, 0.5);
}

@keyframes bounceY {
    0% {
        top: 20%;
    }

    100% {
        top: 80%;
    }
}

@keyframes bounceX {
    0% {
        left: 10%;
    }

    100% {
        left: 80%;
    }
}

.coder-output-text {
    font-family: monospace;
    font-size: 0.8rem;
    color: #4ade80;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    display: none;
    white-space: pre-wrap;
    text-align: left;
}