/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

/* Container principal do jogo */
.game-container {
    display: grid;
    grid-template-areas: 
        "header header"
        "main sidebar";
    grid-template-columns: 1fr 300px;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header do jogo */
.game-header {
    grid-area: header;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo h1 {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.logo p {
    color: #666;
    font-size: 1.1rem;
    font-weight: 300;
}

.player-stats {
    display: flex;
    gap: 30px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(45deg, #f093fb 0%, #f5576c 100%);
    padding: 10px 20px;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
}

.stat-icon {
    font-size: 1.2rem;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Barra de progresso */
.progress-container {
    grid-area: header;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 10px;
    width: 10%;
    transition: width 0.5s ease;
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.4);
}

.progress-text {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Área principal do jogo */
.game-main {
    grid-area: main;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow-y: auto;
}

/* Telas do jogo */
.screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    text-align: center;
}

.screen.hidden {
    display: none;
}

/* Tela de boas-vindas */
.welcome-content h2 {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-content p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 40px;
    max-width: 600px;
}

.welcome-features {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    justify-content: center;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 15px;
    color: white;
    min-width: 150px;
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.3);
    transition: transform 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 2rem;
}

/* Botões */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(45deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.4);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
    margin: 0 5px;
}

/* Container de exercício */
.exercise-container {
    width: 100%;
    max-width: 900px;
}

.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.exercise-header h3 {
    font-family: 'Orbitron', monospace;
    font-size: 1.8rem;
    color: #333;
}

.difficulty-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
}

.difficulty-badge.iniciante {
    background: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.difficulty-badge.intermediario {
    background: linear-gradient(45deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.difficulty-badge.avancado {
    background: linear-gradient(45deg, #ff9a9e 0%, #fecfef 100%);
    color: #333;
}

/* Conteúdo do exercício */
.exercise-content {
    display: grid;
    gap: 25px;
}

.exercise-description {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 25px;
    border-radius: 15px;
    border-left: 5px solid #667eea;
}

.exercise-description h4 {
    font-family: 'Orbitron', monospace;
    margin-bottom: 10px;
    color: #333;
}

.exercise-description p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Editor de código */
.code-editor-container {
    background: #2d3748;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.editor-header {
    background: #1a202c;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-weight: 600;
}

.editor-actions {
    display: flex;
    gap: 10px;
}

.code-editor {
    padding: 20px;
    background: #2d3748;
    min-height: 200px;
}

.code-editor pre {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    color: #e2e8f0;
}

.code-editor code {
    background: none !important;
    padding: 0 !important;
    border: none !important;
    outline: none;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Container de saída */
.output-container {
    background: #1a202c;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.output-header {
    background: #2d3748;
    padding: 15px 20px;
    color: white;
    font-weight: 600;
}

.output-content {
    padding: 20px;
    background: #1a202c;
    min-height: 100px;
    color: #e2e8f0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
}

.output-placeholder {
    color: #718096;
    font-style: italic;
}

/* Ações do exercício */
.exercise-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* Tela de sucesso */
.success-content {
    text-align: center;
    max-width: 500px;
}

.success-animation {
    margin-bottom: 30px;
}

.celebration {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

.success-content h2 {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    color: #4ade80;
    margin-bottom: 15px;
}

.success-stats {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 10px;
    border-left: 4px solid #0ea5e9;
}

.stat-label {
    font-weight: 600;
    color: #333;
}

.stat-value {
    font-weight: 700;
    color: #0ea5e9;
}

/* Tela de conclusão */
.complete-content {
    text-align: center;
    max-width: 600px;
}

.complete-animation {
    margin-bottom: 30px;
}

.trophy {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: rotate 2s ease-in-out infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(10deg); }
    100% { transform: rotate(0deg); }
}

.complete-content h2 {
    font-family: 'Orbitron', monospace;
    font-size: 3rem;
    background: linear-gradient(45deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
}

.final-stats {
    display: grid;
    gap: 20px;
    margin-bottom: 40px;
}

.final-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 15px;
    border-left: 5px solid #f59e0b;
}

.final-stat-label {
    font-weight: 600;
    color: #92400e;
    font-size: 1.1rem;
}

.final-stat-value {
    font-weight: 700;
    color: #92400e;
    font-size: 1.2rem;
}

.complete-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Sidebar */
.game-sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-section h4 {
    font-family: 'Orbitron', monospace;
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1rem;
}

/* Lista de conceitos */
.concepts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.concept-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.concept-item.unlocked {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-left: 4px solid #10b981;
}

.concept-item.locked {
    background: #f3f4f6;
    color: #9ca3af;
}

.concept-icon {
    font-size: 1.2rem;
}

.concept-name {
    font-weight: 500;
}

/* Lista de conquistas */
.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.achievement-item.unlocked {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.achievement-item.locked {
    background: #f3f4f6;
    color: #9ca3af;
}

.achievement-icon {
    font-size: 1.2rem;
}

.achievement-name {
    font-weight: 500;
}

/* Chat de ajuda */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 300px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid #e2e8f0;
}

.chat-message {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: flex-start;
}

.chat-message.bot {
    flex-direction: row;
}

.chat-message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.message-text {
    background: white;
    padding: 10px 15px;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 80%;
    word-wrap: break-word;
}

.chat-message.user .message-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.chat-input {
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    outline: none;
    font-size: 0.9rem;
}

.chat-input input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chat-input button {
    padding: 10px 15px;
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.chat-input button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Modais */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    font-family: 'Orbitron', monospace;
    color: #333;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #9ca3af;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 25px;
}

.modal-body pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
}

/* Responsividade */
@media (max-width: 1200px) {
    .game-container {
        grid-template-areas: 
            "header"
            "main"
            "sidebar";
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
    
    .game-sidebar {
        flex-direction: row;
        overflow-x: auto;
    }
    
    .sidebar-section {
        min-width: 250px;
        flex-shrink: 0;
    }
}

@media (max-width: 768px) {
    .game-container {
        padding: 10px;
        gap: 10px;
    }
    
    .game-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .player-stats {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .welcome-features {
        flex-direction: column;
        align-items: center;
    }
    
    .exercise-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .complete-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .game-sidebar {
        flex-direction: column;
    }
    
    .sidebar-section {
        min-width: auto;
    }
}

/* Animações adicionais */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.screen:not(.hidden) {
    animation: fadeIn 0.5s ease;
}

.exercise-container {
    animation: slideInUp 0.5s ease;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #5a67d8, #6b46c1);
}
