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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f7;
    color: #1d1d1f;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

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

h1 {
    font-size: 2.5em;
    font-weight: 600;
    margin-bottom: 10px;
}

.subtitle {
    color: #86868b;
    font-size: 1.1em;
}

.controls {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.room-settings, .furniture-panel {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.room-settings {
    flex: 0 0 300px;
}

.furniture-panel {
    flex: 1;
    min-width: 300px;
}

h3 {
    margin-bottom: 15px;
    color: #1d1d1f;
}

.input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 5px;
}

input[type="number"], input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 6px;
    font-size: 14px;
    width: 80px;
}

input[type="text"] {
    width: 120px;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #0071e3;
    color: white;
}

.btn-primary:hover {
    background-color: #0051d5;
}

.btn-secondary {
    background-color: #f5f5f7;
    color: #1d1d1f;
    border: 1px solid #d2d2d7;
}

.btn-secondary:hover {
    background-color: #e8e8ed;
}

.btn-danger {
    background-color: #ff3b30;
    color: white;
}

.btn-danger:hover {
    background-color: #ff1f1f;
}

.furniture-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.furniture-item {
    background: #f5f5f7;
    border: 2px solid #d2d2d7;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: move;
    transition: all 0.2s;
}

.furniture-item:hover {
    background: #e8e8ed;
    border-color: #0071e3;
}

.furniture-icon {
    font-size: 2em;
    margin-bottom: 5px;
}

.furniture-item span {
    font-size: 12px;
    color: #1d1d1f;
}

.custom-furniture {
    border-top: 1px solid #d2d2d7;
    padding-top: 15px;
}

h4 {
    margin-bottom: 10px;
    font-size: 1em;
}

.main-area {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.zoom-controls {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f5f5f7;
    padding: 5px 10px;
    border-radius: 6px;
}

.zoom-controls button {
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 18px;
}

.room-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    overflow: auto;
    max-height: 600px;
    background: #fafafa;
    border-radius: 8px;
    padding: 20px;
}

.room {
    position: relative;
    background: white;
    border: 3px solid #1d1d1f;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(0deg, #f0f0f0 0, #f0f0f0 1px, transparent 1px, transparent 20px),
        repeating-linear-gradient(90deg, #f0f0f0 0, #f0f0f0 1px, transparent 1px, transparent 20px);
    pointer-events: none;
}

.placed-furniture {
    position: absolute;
    background: #0071e3;
    border: 2px solid #0051d5;
    border-radius: 4px;
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 500;
    user-select: none;
    transition: all 0.2s;
}

.placed-furniture:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.placed-furniture.selected {
    border-color: #ff3b30;
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.3);
}

.placed-furniture.dragging {
    opacity: 0.8;
    cursor: grabbing;
}

.resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: white;
    border: 2px solid #0071e3;
    border-radius: 50%;
}

.resize-handle.se {
    bottom: -5px;
    right: -5px;
    cursor: se-resize;
}

.info-panel {
    border-top: 1px solid #d2d2d7;
    padding-top: 20px;
}

.selected-info {
    background: #f5f5f7;
    padding: 15px;
    border-radius: 8px;
}

.selected-info p {
    margin-bottom: 5px;
    color: #86868b;
}

.selected-info .info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.selected-info .info-label {
    font-weight: 500;
    color: #1d1d1f;
}

.delete-btn {
    margin-top: 10px;
    width: 100%;
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
    }
    
    .room-settings, .furniture-panel {
        flex: 1;
        width: 100%;
    }
    
    .furniture-items {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .toolbar {
        justify-content: center;
    }
    
    .zoom-controls {
        margin-left: 0;
        margin-top: 10px;
    }
}