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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    display: flex;
    height: 100%;
    min-height: 0;
}

.module-tabs {
    display: flex;
    gap: 10px;
    padding: 12px 20px;
    background: #1f2d3a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border-bottom: 1px solid #233446;
}

.module-tab {
    padding: 10px 16px;
    background: #34495e;
    color: #ecf0f1;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.25s ease;
}

.module-tab:hover {
    background: #3f5873;
    transform: translateY(-1px);
}

.module-tab.active {
    background: #3498db;
    color: white;
    box-shadow: 0 6px 16px rgba(52,152,219,0.35);
}

.module-view {
    flex: 1;
    display: none;
    min-height: 0;
}

.module-view.active {
    display: block;
}

.module-view > .container {
    height: 100%;
}

.sidebar {
    width: 280px;
    background: #2c3e50;
    color: white;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar h2 {
    margin-bottom: 20px;
    color: #ecf0f1;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.element-category {
    margin-bottom: 25px;
}

.element-category h3 {
    margin-bottom: 15px;
    color: #bdc3c7;
    font-size: 14px;
    text-transform: uppercase;
}

.element-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: #34495e;
    border-radius: 8px;
    cursor: grab;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.element-item:hover {
    background: #3498db;
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.element-item:active {
    cursor: grabbing;
}

.element-icon {
    font-size: 20px;
    margin-right: 12px;
    width: 30px;
    text-align: center;
}

.element-name {
    font-size: 14px;
    color: #ecf0f1;
}

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.workspace {
    flex: 1;
    display: flex;
    min-height: 0;
}

.toolbar {
    display: flex;
    padding: 15px 20px;
    background: #34495e;
    gap: 10px;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tool-btn {
    padding: 8px 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.tool-btn:active {
    transform: translateY(0);
}

.canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #ecf0f1;
}

#main-canvas {
    position: absolute;
    top: 0;
    left: 0;
    cursor: crosshair;
    background: white;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.upload-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    padding: 12px 20px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.upload-btn:hover {
    background: #219a52;
    transform: translateY(-2px);
}

.properties-panel {
    width: 320px;
    background: #2c3e50;
    color: white;
    padding: 20px;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
    height: 100%;
}

.properties-panel h3 {
    margin-bottom: 20px;
    color: #ecf0f1;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

#element-properties {
    color: #bdc3c7;
}

.property-group {
    margin-bottom: 20px;
}

.property-group label {
    display: block;
    margin-bottom: 5px;
    color: #ecf0f1;
    font-size: 14px;
}

.property-group input,
.property-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #34495e;
    border-radius: 4px;
    background: #34495e;
    color: white;
    font-size: 14px;
}

.property-group input:focus,
.property-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.element-selected {
    border-color: #e74c3c !important;
    background: #e74c3c !important;
}

.cameracoverage {
    fill: rgba(52, 152, 219, 0.3);
    stroke: #3498db;
    stroke-width: 2;
}

.cameraicon {
    fill: #2c3e50;
}

.networkicon {
    fill: #27ae60;
}

.infrastructureicon {
    fill: #e67e22;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #34495e;
}

::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* Responsive design */
@media (max-width: 1200px) {
    .sidebar {
        width: 250px;
    }
    
    .properties-panel {
        width: 260px;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 200px;
    }
    
    .properties-panel {
        width: 100%;
        height: 180px;
    }
}

/* Planos module */
.planos-sidebar {
    background: linear-gradient(180deg, #28384a 0%, #1f2d3a 100%);
}

.planos-description {
    margin-bottom: 16px;
    color: #ecf0f1;
    line-height: 1.4;
}

.planos-key {
    background: rgba(255,255,255,0.04);
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    color: #bdc3c7;
    line-height: 1.5;
}

.planos-key ul {
    margin-top: 8px;
    padding-left: 18px;
    color: #ecf0f1;
}

.planos-toolbar {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.planos-toolset,
.planos-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.planos-tool-btn.active {
    background: #1abc9c;
    box-shadow: 0 4px 12px rgba(26,188,156,0.35);
}

.planos-canvas-container {
    background-image:
        linear-gradient(to right, rgba(0,0,0,0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0,0,0,0.04) 1px, transparent 1px);
    background-size: 32px 32px;
}

#planos-canvas {
    position: absolute;
    top: 0;
    left: 0;
    cursor: crosshair;
    background: transparent;
}

.planos-property-inline {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.planos-property-inline .property-group {
    margin-bottom: 0;
}
