* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #007acc;
    --secondary: #2c3e50;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
    --dark: #1a1a1a;
    --light: #ecf0f1;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--dark);
    color: var(--light);
    overflow: hidden;
}

/* MODAIS */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--secondary);
    padding: 30px;
    border-radius: 15px;
    min-width: 400px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.modal-content.large {
    min-width: 800px;
}

/* LOGIN */
.login-container {
    width: 100%;
}

.login-tabs {
    display: flex;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
}

.login-tabs button {
    flex: 1;
    padding: 15px;
    border: none;
    background: #34495e;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
}

.login-tabs button:hover {
    background: #3d566e;
}

.login-tabs .tab-active {
    background: var(--primary);
}

.login-form {
    animation: fadeIn 0.3s ease;
}

.login-form h3 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary);
}

.login-form input, .login-form select {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 2px solid #34495e;
    border-radius: 6px;
    background: #2c3e50;
    color: white;
    font-size: 16px;
}

.login-form input:focus, .login-form select:focus {
    border-color: var(--primary);
    outline: none;
}

.login-form button {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 16px;
    transition: background 0.3s;
}

.login-form button:hover {
    background: #005a9e;
}

.login-link {
    text-align: center;
    margin-top: 15px;
    color: #95a5a6;
    cursor: pointer;
    text-decoration: underline;
}

.login-link:hover {
    color: var(--primary);
}

/* HEADER */
.ide-header {
    background: var(--secondary);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 50px;
    border-bottom: 1px solid #34495e;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: bold;
    color: var(--primary);
}

.main-menu {
    display: flex;
    gap: 0;
}

.menu-item {
    position: relative;
    padding: 15px 20px;
    cursor: pointer;
    transition: background 0.3s;
}

.menu-item:hover {
    background: #34495e;
}

.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--secondary);
    min-width: 200px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: none;
    z-index: 100;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

.submenu div {
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.3s;
}

.submenu div:hover {
    background: #34495e;
}

.divider {
    height: 1px;
    background: #34495e;
    margin: 5px 0;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-menu {
    position: relative;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: background 0.3s;
}

.user-menu:hover {
    background: #34495e;
}

/* TOOLBAR */
.toolbar {
    background: #34495e;
    padding: 10px 20px;
    display: flex;
    gap: 10px;
    align-items: center;
    border-bottom: 1px solid #2c3e50;
    flex-wrap: wrap;
}

.toolbar button, .toolbar select {
    padding: 8px 15px;
    border: 1px solid #2c3e50;
    background: var(--secondary);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.toolbar button:hover, .toolbar select:hover {
    background: #3d566e;
}

.btn-run {
    background: var(--success) !important;
}

.btn-run:hover {
    background: #219653 !important;
}

.toolbar-separator {
    width: 1px;
    height: 30px;
    background: #2c3e50;
    margin: 0 10px;
}

/* WORKSPACE */
.workspace {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    background: #2c3e50;
}

/* EDITOR ÚNICO COM LINHAS COLORIDAS */
.editor-panel {
    background: var(--dark);
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
}

.panel-header {
    background: #2c3e50;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #34495e;
    font-weight: 600;
}

.panel-tabs {
    margin-left: auto;
    display: flex;
    background: #2c3e50;
    border-radius: 4px;
    overflow: hidden;
}

.panel-tabs button {
    padding: 5px 15px;
    border: none;
    background: transparent;
    color: #95a5a6;
    cursor: pointer;
    transition: background 0.3s;
}

.panel-tabs button:hover {
    background: #34495e;
}

.panel-tabs .tab-active {
    background: var(--primary);
    color: white;
}

.panel-actions {
    margin-left: auto;
}

.panel-actions i {
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    transition: background 0.3s;
}

.panel-actions i:hover {
    background: #34495e;
}

#codigo {
    width: 100%;
    height: 100%;
    border: none;
    padding: 20px 20px 20px 50px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: none;
    outline: none;
    line-height: 20px;
    color: #ffffff;
}

/* LINHAS COLORIDAS ALTERNADAS - 3 CORES */
#codigo {
    background: linear-gradient(180deg, 
        #1a1a1a 0%, 
        #1a1a1a 19px,     /* Linha 1 - Cinza escuro */
        #2a2a2a 20px, 
        #2a2a2a 39px,     /* Linha 2 - Cinza médio */
        #1a1a2a 40px,
        #1a1a2a 59px,     /* Linha 3 - Azul escuro */
        #2a2a3a 60px,
        #2a2a3a 79px,     /* Linha 4 - Azul médio */
        #1a2a1a 80px,
        #1a2a1a 99px,     /* Linha 5 - Verde escuro */
        #2a3a2a 100px,
        #2a3a2a 119px,    /* Linha 6 - Verde médio */
        #1a1a1a 120px     /* Repete o padrão */
    );
    background-size: 100% 120px;
}

/* NUMERAÇÃO DAS LINHAS */
.editor-panel::before {
    content: "";
    position: absolute;
    left: 0;
    top: 40px;
    bottom: 0;
    width: 40px;
    background: rgba(255,255,255,0.05);
    border-right: 1px solid #34495e;
    pointer-events: none;
}

/* ÁREA DE SAÍDA OCULTA INICIALMENTE */
.output-area {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: white;
    z-index: 10000;
    padding: 20px;
    overflow: auto;
}

.output-area.active {
    display: block;
}

/* BOTÃO FECHAR TELA CHEIA */
.btn-close-fullscreen {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    z-index: 10001;
    font-size: 16px;
}

.btn-close-fullscreen:hover {
    background: #c0392b;
}

.output-fullscreen {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 60px;
}

/* ELEMENTOS GRÁFICOS VANTU */
.tela-grafica {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
    background: var(--dark);
}

.vantu-tela {
    min-height: 400px;
    padding: 20px;
    border-radius: 10px;
    margin: 10px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.vantu-elemento {
    margin: 10px 0;
    padding: 15px;
    border-radius: 8px;
    animation: aparecer 0.5s ease;
}

.vantu-titulo h1 {
    font-size: 2em;
    margin: 0;
    text-align: center;
    color: inherit;
}

.vantu-texto p {
    font-size: 1.1em;
    margin: 5px 0;
    color: inherit;
}

.vantu-botao {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
}

.vantu-botao:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.vantu-campo {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
}

.vantu-rotulo {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #2c3e50;
}

.vantu-input {
    width: 100%;
    padding: 10px;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    font-size: 16px;
}

.vantu-input:focus {
    border-color: #3498db;
    outline: none;
}

.vantu-menu nav {
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
    padding: 15px;
    color: inherit;
}

/* CORES DAS TELAS */
.tela-azul { background: #3498db; color: white; }
.tela-preta { background: #2c3e50; color: white; }
.tela-verde { background: #27ae60; color: white; }
.tela-sem-cor { background: #ecf0f1; color: #2c3e50; }
.tela-video { background: #000; color: white; }
.tela-camera { background: #8e44ad; color: white; }
.tela-quadro { background: #d35400; color: white; }
.tela-corpo { background: #16a085; color: white; }
.tela-algoritmo { background: #c0392b; color: white; }

.console-saida {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    background: #1a1a1a;
    color: #00ff00;
    white-space: pre-wrap;
}

/* STATUS BAR */
.status-bar {
    background: var(--secondary);
    padding: 5px 20px;
    display: flex;
    gap: 20px;
    align-items: center;
    height: 30px;
    border-top: 1px solid #34495e;
    font-size: 12px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* EXEMPLOS */
.exemplos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.exemplo-card {
    background: #34495e;
    padding: 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.exemplo-card:hover {
    transform: translateY(-2px);
    background: var(--primary);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.exemplo-card h3 {
    margin-bottom: 10px;
    color: white;
}

.exemplo-card p {
    color: #ecf0f1;
    font-size: 14px;
}

/* CONFIGURAÇÕES */
.config-tabs {
    display: flex;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
}

.config-tabs button {
    flex: 1;
    padding: 10px;
    border: none;
    background: #34495e;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
}

.config-tabs button:hover {
    background: #3d566e;
}

.config-tabs .tab-active {
    background: var(--primary);
}

.config-panel {
    animation: fadeIn 0.3s ease;
}

.config-panel h3 {
    margin-bottom: 15px;
    color: var(--light);
    border-bottom: 1px solid #34495e;
    padding-bottom: 10px;
}

.config-panel label {
    display: block;
    margin: 15px 0;
    color: #ecf0f1;
}

.config-panel input, .config-panel select {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    background: #2c3e50;
    border: 1px solid #34495e;
    color: white;
    border-radius: 4px;
}

.config-panel button {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.config-panel button:hover {
    background: #005a9e;
}

.btn-close, .btn-donate {
    width: 100%;
    padding: 10px;
    margin-top: 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.btn-close {
    background: #95a5a6;
    color: white;
}

.btn-close:hover {
    background: #7f8c8d;
}

.btn-donate {
    background: var(--warning);
    color: white;
}

.btn-donate:hover {
    background: #e67e22;
}

/* DOCUMENTAÇÃO */
.doc-content {
    max-height: 400px;
    overflow-y: auto;
}

.doc-content h3 {
    margin: 20px 0 10px 0;
    color: var(--primary);
}

.doc-content pre {
    background: #34495e;
    padding: 15px;
    border-radius: 5px;
    margin: 10px 0;
    overflow-x: auto;
}

.doc-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.doc-content li {
    margin: 5px 0;
    color: #ecf0f1;
}

.doc-content code {
    background: #2c3e50;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

/* NOTIFICAÇÕES */
.notificacao {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
    color: white;
}

.notificacao button {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ESTILOS PARA MENSAGENS DE ERRO */
.erro-linha {
    background: #e74c3c !important;
    color: white !important;
    padding: 5px 10px;
    margin: 2px 0;
    border-radius: 3px;
    font-weight: bold;
}

.sucesso-linha {
    background: #27ae60 !important;
    color: white !important;
    padding: 5px 10px;
    margin: 2px 0;
    border-radius: 3px;
    font-weight: bold;
}

/* ANIMAÇÕES */
@keyframes aparecer {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* RESPONSIVIDADE */
@media (max-width: 480px) {
    .modal-content {
        min-width: 95%;
        margin: 10px;
        padding: 20px;
    }
    
    .modal-content.large {
        min-width: 95%;
    }
    
    .main-menu {
        display: none;
    }
    
    .toolbar {
        padding: 5px 10px;
    }
    
    .toolbar button, .toolbar select {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .exemplos-grid {
        grid-template-columns: 1fr;
    }
}

/* DETECÇÃO DE DISPOSITIVOS */
.mobile .ide-header { padding: 0 10px; }
.mobile .toolbar { padding: 5px 10px; }

.kaios .modal-content { min-width: 240px; }
.kaios body { font-size: 12px; }

.tablet .workspace { grid-template-columns: 1fr 1fr; }

/* TEMAS */
.tema-claro {
    --dark: #ecf0f1;
    --light: #2c3e50;
    --secondary: #bdc3c7;
}

.tema-escuro {
    --dark: #1a1a1a;
    --light: #ecf0f1;
    --secondary: #2c3e50;
}