* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --secondary-color: #2c3e50;
    --secondary-dark: #1c2833;
    --accent-color: #f39c12;
    --text-light: #f5f5f5;
    --text-dark: #333;
    --background-light: #f5f5f5;
    --background-dark: #1a1a1a;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-light);
    color: var(--text-dark);
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
    background-color: var(--background-dark);
    color: var(--text-light);
}

.header {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

body.dark-mode .header {
    background-color: var(--secondary-dark);
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.header p {
    font-size: 1rem;
    opacity: 0.9;
}

.container {
    display: flex;
    height: calc(100vh - 80px);
    width: 100%;
}

.sidebar {
    width: 280px;
    background-color: var(--secondary-color);
    color: white;
    padding: 15px;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    border-radius: 0 0 0 8px;
}

body.dark-mode .sidebar {
    background-color: var(--secondary-dark);
}

.sidebar h2, .sidebar h3 {
    margin-bottom: 15px;
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.tool-btn {
    padding: 10px;
    border: none;
    background-color: #34495e;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tool-btn:hover {
    background-color: #4a6b8a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.tool-btn.active {
    background-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

.properties-panel {
    background-color: #34495e;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    flex-grow: 1;
    overflow-y: auto;
    min-height: 250px;
    font-size: 1.1em;
}

.properties-panel h3 {
    margin-bottom: 15px;
    font-size: 1.2em;
}

.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.actions button {
    padding: 10px;
    border: none;
    background-color: var(--primary-color);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.actions button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.canvas-container {
    flex-grow: 1;
    background-color: #ecf0f1;
    position: relative;
    overflow: hidden;
}

body.dark-mode .canvas-container {
    background-color: #2c3e50;
}

.canvas-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 5px 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10;
}

.canvas-controls button {
    width: 30px;
    height: 30px;
    border: none;
    background-color: #3498db;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#blueprint-canvas {
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

body.dark-mode #blueprint-canvas {
    background-color: #34495e;
}

/* Estilos para elementos del blueprint */
.wall {
    stroke: #333;
    stroke-width: 5;
}

.door {
    stroke: #e74c3c;
    stroke-width: 3;
    fill: none;
}

.sliding-door {
    stroke: #e74c3c;
    stroke-width: 3;
    fill: none;
    stroke-dasharray: 5, 2;
}

.window {
    stroke: #3498db;
    stroke-width: 2;
    fill: rgba(52, 152, 219, 0.2);
}

.skylight {
    stroke: #3498db;
    stroke-width: 2;
    fill: rgba(52, 152, 219, 0.1);
    stroke-dasharray: 2, 1;
}

.column {
    stroke: #8e44ad;
    stroke-width: 2;
    fill: rgba(142, 68, 173, 0.3);
}

.stairs-up {
    stroke: #d35400;
    stroke-width: 2;
    fill: rgba(211, 84, 0, 0.3);
}

.stairs-down {
    stroke: #d35400;
    stroke-width: 2;
    fill: rgba(211, 84, 0, 0.2);
    stroke-dasharray: 4, 2;
}

.single-step {
    stroke: #d35400;
    stroke-width: 1;
    fill: rgba(211, 84, 0, 0.4);
}

.ramp {
    stroke: #16a085;
    stroke-width: 2;
    fill: rgba(22, 160, 133, 0.2);
    stroke-dasharray: 8, 2;
}

.furniture {
    stroke: #2ecc71;
    stroke-width: 1;
    fill: rgba(46, 204, 113, 0.3);
}

.selected {
    stroke: #f39c12 !important;
    stroke-dasharray: 5;
}

/* Nuevos elementos de la interfaz */
.blueprint-name-input,
.units-selector,
.floors-selector,
.furniture-library {
    background-color: #34495e;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 15px;
}

body.dark-mode .blueprint-name-input,
body.dark-mode .units-selector,
body.dark-mode .floors-selector,
body.dark-mode .furniture-library {
    background-color: #2c3e50;
}

.blueprint-name-input h3,
.units-selector h3,
.floors-selector h3,
.furniture-library h3 {
    margin-bottom: 10px;
    font-size: 16px;
}

#blueprint-name,
#units-select,
#floor-select,
.scale-input input {
    width: 100%;
    padding: 5px;
    margin-bottom: 8px;
    border-radius: 4px;
    border: 1px solid #2c3e50;
}

.floors-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.floors-controls select {
    grid-column: span 2;
    margin-bottom: 8px;
}

.furniture-items {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.furniture-item {
    background-color: #3498db;
    padding: 8px;
    border-radius: 4px;
    text-align: center;
    cursor: grab;
    transition: background-color 0.3s;
    user-select: none;
}

.furniture-item:hover {
    background-color: #2980b9;
}

.furniture-item:active {
    cursor: grabbing;
}

/* Estilos para los controles de redimensionamiento */
.resize-handle {
    width: 8px;
    height: 8px;
    background-color: #f39c12;
    border: 1px solid white;
    position: absolute;
    z-index: 10;
}

.history-controls {
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

.history-controls button {
    width: auto;
    padding: 0 10px;
}

#dark-mode-toggle {
    margin-left: 10px;
    font-size: 14px;
}

.export-options {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

body.dark-mode .export-options {
    background-color: #2c3e50;
    color: white;
}

.export-options h3 {
    margin-bottom: 15px;
    text-align: center;
}

.export-options div {
    margin-bottom: 10px;
}

.export-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.export-buttons button {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#export-confirm {
    background-color: #3498db;
    color: white;
}

#export-cancel {
    background-color: #e74c3c;
    color: white;
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .header p {
        font-size: 0.9rem;
    }
    
    .container {
        flex-direction: column;
        height: calc(100vh - 70px);
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        border-radius: 0;
    }
    
    .tools, .actions {
        grid-template-columns: repeat(3, 1fr);
    }
}
