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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    min-height: 100vh;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    font-weight: 700;
}

.layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Seitenleiste */
.sidebar {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
    height: fit-content;
}

.sidebar h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #34495e;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

.furniture-library {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.furniture-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: grab;
    transition: all 0.3s ease;
}

.furniture-item:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-2px);
}

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

.furniture-icon {
    font-size: 24px;
    margin-right: 10px;
}

.furniture-info {
    display: flex;
    flex-direction: column;
}

.furniture-name {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.furniture-size {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Hauptbereich */
.floorplan-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: flex-end;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.btn-blue {
    background-color: #3498db;
    color: white;
}

.btn-blue:hover {
    background-color: #2980b9;
}

.btn-green {
    background-color: #27ae60;
    color: white;
}

.btn-green:hover {
    background-color: #229954;
}

/* Grundriss */
.floorplan {
    position: relative;
    background-color: #ecf0f1;
    border-radius: 8px;
    height: 800px;
    overflow: hidden;
}

.room {
    position: absolute;
    border: 3px solid;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.room:hover {
    opacity: 0.9;
}

/* Amon Zimmer - 16.72 m² - KORREKT VERMESSEN */
.room-amon {
    left: 50px;
    top: 50px;
    width: 300px;  /* 4,35m bei korrektem Scale */
    height: 265px; /* 3,84m bei korrektem Scale */
    background-color: #e8f4fd;
    border-color: #3498db;
}

/* Yoga Zimmer - 12.76 m² - KORREKT VERMESSEN */
.room-yoga {
    left: 50px;
    top: 380px;  /* Größerer Abstand zwischen Räumen */
    width: 300px; /* 4,37m bei korrektem Scale */
    height: 200px; /* 2,92m bei korrektem Scale */
    background-color: #e8f8f5;
    border-color: #27ae60;
}

.room-label {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.room-name {
    font-weight: bold;
    font-size: 1.1rem;
}

.room-amon .room-name {
    color: #2980b9;
}

.room-yoga .room-name {
    color: #229954;
}

.room-size {
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* Türen und Fenster - Basis-Styles */
.draggable-door, .draggable-window {
    position: absolute;
    cursor: move;
    border: 1px solid #000;
    z-index: 5;
}

.draggable-door {
    background: red;
}

.draggable-window {
    background: #87CEEB;
}

/* Spezifische Positionen für Türen und Fenster */
#door-amon {
    left: 49px;
    top: 247px;
    width: 6px;
    height: 55px;
}

#door-yoga {
    left: 49px;
    top: 495px;
    width: 6px;
    height: 55px;
}

#window-amon {
    left: 345px;
    top: 152px;
    width: 6px;
    height: 115px;
}

#window-yoga {
    left: 345px;
    top: 425px;
    width: 6px;
    height: 115px;
}

/* Wandmaße - FINALE KORREKTE POSITIONEN */
.wall-measurement {
    position: absolute;
    font-size: 0.8rem;
    font-weight: 600;
    color: #2c3e50;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    z-index: 15;
    white-space: nowrap;
}

/* Amon Zimmer Wandmaße - FINALE KORREKTE POSITIONEN */
.wall-amon-top {
    left: 175px;
    top: 20px;
}

.wall-amon-right {
    left: 345px;
    top: 167px;
    transform: rotate(90deg);
    transform-origin: center;
}

.wall-amon-bottom {
    left: 175px;
    top: 325px;
}

.wall-amon-left {
    left: 5px;
    top: 167px;
    transform: rotate(-90deg);
    transform-origin: center;
}

/* Yoga Zimmer Wandmaße - FINALE KORREKTE POSITIONEN */
.wall-yoga-top {
    left: 175px;
    top: 350px;
}

.wall-yoga-right {
    left: 345px;
    top: 465px;
    transform: rotate(90deg);
    transform-origin: center;
}

.wall-yoga-bottom {
    left: 175px;
    top: 590px;
}

.wall-yoga-left {
    left: 5px;
    top: 465px;
    transform: rotate(-90deg);
    transform-origin: center;
}

/* Anleitung */
.instructions {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 300px;
}

.instructions p {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 5px;
    color: #666;
}

.instructions p:last-child {
    margin-bottom: 0;
}

/* Möbel Styles */
.room.highlighted {
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.6);
    transform: scale(1.05);
}

.placed-furniture.selected {
    border-color: #e74c3c !important;
    border-width: 3px !important;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
    z-index: 100 !important;
}

.delete-furniture-btn:hover {
    background-color: #c0392b !important;
}

.rotate-furniture-btn:hover {
    background-color: #2980b9 !important;
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .layout {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .floorplan {
        height: 700px;
    }
    
    .room-amon,
    .room-yoga {
        left: 20px;
    }
    
    .room-amon {
        width: 350px;
        height: 280px;
    }
    
    .room-yoga {
        top: 350px;
        width: 350px;
        height: 220px;
    }
    
    .instructions {
        position: static;
        margin-top: 20px;
        max-width: none;
    }
}
