* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    text-align: center;
}

header h1 {
    font-size: 2em;
    font-weight: 600;
    margin: 0;
}

.controls {
    display: flex;
    gap: 15px;
    padding: 25px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    flex-wrap: wrap;
    align-items: flex-end;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-group label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9em;
}

.input-group input {
    padding: 10px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1em;
    width: 150px;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-add {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-clear {
    background: #dc3545;
    color: white;
}

.btn-clear:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-export {
    background: #28a745;
    color: white;
}

.btn-export:hover {
    background: #218838;
    transform: translateY(-2px);
}

.workspace {
    display: flex;
    gap: 20px;
    padding: 25px;
    min-height: 600px;
}

.info-panel {
    width: 280px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    height: fit-content;
}

.info-panel h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.1em;
}

#listaComodos {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.comodo-item {
    background: white;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.comodo-item strong {
    color: #667eea;
    display: block;
    margin-bottom: 5px;
}

.comodo-item span {
    color: #6c757d;
    font-size: 0.9em;
}

.legenda {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.legenda p {
    color: #495057;
    margin-bottom: 10px;
    font-weight: 600;
}

.legenda ul {
    list-style: none;
    padding: 0;
}

.legenda li {
    color: #6c757d;
    font-size: 0.85em;
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.legenda li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

.canvas-container {
    flex: 1;
    position: relative;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    overflow: auto;
    min-height: 600px;
}

#canvas {
    display: block;
    cursor: move;
    background: #ffffff;
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Scrollbar styling */
#listaComodos::-webkit-scrollbar {
    width: 8px;
}

#listaComodos::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#listaComodos::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

#listaComodos::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

@media (max-width: 1024px) {
    body {
        padding: 0;
    }
    
    .container {
        border-radius: 0;
        min-height: 100vh;
    }
    
    header {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.3em;
    }
    
    .controls {
        padding: 10px;
        gap: 8px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .input-group {
        width: 100%;
    }
    
    .input-group input {
        width: 100%;
    }
    
    button {
        width: 100%;
    }
    
    .workspace {
        flex-direction: column;
        padding: 10px;
        gap: 15px;
    }
    
    .info-panel {
        width: 100%;
        border-radius: 8px;
        padding: 15px;
    }
    
    .info-panel h3 {
        font-size: 1em;
        margin-bottom: 10px;
    }
    
    .comodo-item {
        padding: 10px;
        margin-bottom: 10px;
        font-size: 0.9em;
    }
    
    .legenda {
        padding: 12px;
        margin-top: 15px;
    }
    
    .legenda p {
        font-size: 0.9em;
        margin-bottom: 8px;
    }
    
    .legenda li {
        font-size: 0.8em;
        margin-bottom: 6px;
    }
    
    .canvas-container {
        width: 100%;
        border-radius: 8px;
        border: 2px solid #dee2e6;
        min-height: 600px;
        overflow: auto;
    }
    
    #canvas {
        display: block;
        min-width: 100%;
        min-height: 600px;
    }
}
