:root {
    --primary-color: #4A90E2;
    --accent-color: #FF6B6B;
    --bg-color: #f4f7f6;
    --panel-bg: #ffffff;
    --text-color: #333;
}

body {
    font-family: "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    padding: 20px 10px;
    margin: 0;
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}

.app-logo {
    max-width: 100%;
    height: auto;
    width: 350px;
    display: block;
    margin: 0 auto;
}

h1.title {
    text-align: center;
    margin-bottom: 10px;
    margin-top: 0;
    padding: 0 10px;
}

.app-container {
    display: flex; gap: 20px; align-items: flex-start; margin-bottom: 50px;
}

.sidebar {
    flex: 1; min-width: 320px; background: var(--panel-bg);
    padding: 20px; border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    max-height: 90vh; overflow-y: auto;
}

.room-wrapper {
    flex: 2; background: #e0e0e0; padding: 20px; border-radius: 12px;
    overflow: auto; display: flex; justify-content: center; align-items: center;
    min-height: 500px; box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
    user-select: none;
}

h3 { 
    font-size: 16px; border-left: 4px solid var(--primary-color); 
    padding-left: 10px; margin-top: 20px; margin-bottom: 10px;
}

.input-area-box {
    background: #e3f2fd; padding: 15px; border-radius: 8px;
    margin-bottom: 20px; border: 1px solid #bbdefb;
}

.custom-furniture-area {
    background: #f1f8e9; border-color: #c5e1a5;
}

.input-group {
    display: flex; align-items: center; margin-bottom: 10px;
}
.input-group label { width: 60px; font-weight: bold; font-size: 14px; }
.input-group input { 
    flex: 1; padding: 8px; border: 1px solid #ccc; border-radius: 4px; 
    text-align: right; margin-right: 5px;
}
.input-group input[type="text"] { text-align: left; }

.btn-apply {
    width: 100%; padding: 10px; background: var(--primary-color); color: #fff;
    border: none; border-radius: 4px; font-weight: bold; cursor: pointer;
}
.btn-apply:hover { background: #357ABD; }

.btn-create { background: #66bb6a; }
.btn-create:hover { background: #43a047; }

.size-buttons {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 10px;
}
.btn-size {
    padding: 8px 0; font-size: 12px; background: #f0f0f0;
    border: 1px solid #ddd; border-radius: 4px; cursor: pointer;
    transition: all 0.2s;
}
.btn-size:hover { background: #e0e0e0; }
.btn-size.active {
    background: var(--primary-color); color: white;
    border-color: var(--primary-color); font-weight: bold;
}

details { 
    margin-bottom: 10px; border: 1px solid #eee; border-radius: 6px; 
    overflow: hidden; 
}

summary { 
    padding: 12px; 
    background: #f9f9f9; 
    cursor: pointer; 
    font-weight: bold; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    list-style: none;
    transition: background 0.2s;
}

summary::-webkit-details-marker { display: none; }
summary:hover { background: #f0f0f0; }

summary::after {
    content: '\f078';
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

details[open] summary::after { transform: rotate(180deg); }

.furniture-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 10px; background: #fff; }

.btn-add {
    padding: 8px; font-size: 12px; background: #fff; border: 1px solid #ccc;
    border-radius: 4px; cursor: pointer; text-align: left; display: flex; align-items: center;
}
.btn-add:hover { background: #eef6ff; border-color: var(--primary-color); }
.btn-add i { margin-right: 6px; width: 16px; text-align: center; color: var(--primary-color); }

#selected-controls {
    position: sticky; bottom: 0; background: #fff8e1; padding: 15px;
    border-radius: 8px; margin-top: 20px; border: 1px solid #ffe082;
    display: none; z-index: 10;
}
.control-btns { display: flex; gap: 10px; margin-top: 10px; }
.btn-action { flex: 1; padding: 10px; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; color:white; }

.btn-rotate { background: #4A90E2; }
.btn-rotate:hover { background: #357ABD; }

.btn-delete { background: #e74c3c; }
.btn-delete:hover { background: #c0392b; }

#room {
    position: relative;
    background-color: #fdf5e6;
    background-image: 
        linear-gradient(#d7ccc8 1px, transparent 1px),
        linear-gradient(90deg, #d7ccc8 1px, transparent 1px);
    background-size: 50px 50px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    transition: width 0.3s, height 0.3s;
    flex-shrink: 0; 
    transform-origin: center center;
    touch-action: none;
}

.room-dimension { position: absolute; color: #888; font-size: 12px; pointer-events: none; }
#dim-w { top: -20px; left: 0; width: 100%; text-align: center; border-bottom: 1px solid #888; }
#dim-h { left: -25px; top: 0; height: 100%; writing-mode: vertical-rl; text-align: center; border-right: 1px solid #888; }

.item {
    position: absolute; display: flex; justify-content: center; align-items: center;
    font-size: 11px; font-weight: bold; color: #fff; text-align: center;
    border-radius: 2px; cursor: grab; box-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    line-height: 1.1; padding: 2px; box-sizing: border-box; touch-action: none;
}
.item:active { cursor: grabbing; }
.item.selected { outline: 3px solid var(--accent-color); z-index: 100; box-shadow: 0 5px 15px rgba(0,0,0,0.3); }

.cat-living { background: rgba(230, 126, 34, 0.85); border: 1px solid #d35400; }
.cat-bed { background: rgba(52, 152, 219, 0.85); border: 1px solid #2980b9; }
.cat-kitchen { background: rgba(149, 165, 166, 0.85); border: 1px solid #7f8c8d; }
.cat-storage { background: rgba(155, 89, 182, 0.85); border: 1px solid #8e44ad; }
.cat-other { background: rgba(46, 204, 113, 0.85); border: 1px solid #27ae60; }

.cat-window { 
    background: rgba(224, 247, 250, 0.85);
    border: 2px solid #4DD0E1; 
    color: #006064;
    font-size: 10px;
}
.cat-door { 
    background: rgba(200, 200, 200, 0.3);
    border: 1px dashed #757575;
    color: #616161;
    display: flex; justify-content: flex-end; align-items: flex-start;
    padding: 4px;
}

.seo-content {
    background: #fff; padding: 30px; border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03); margin-top: 40px; margin-bottom: 40px;
}
.site-footer {
    text-align: center; padding: 20px 0; margin-top: auto;
    border-top: 1px solid #eee; color: #888; font-size: 14px;
}

.header-nav {
    margin-bottom: 10px;
}

.btn-back-top {
    display: inline-flex;
    align-items: center;
    gap: 6px; 
    text-decoration: none;
    color: #666;
    font-weight: bold;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-back-top:hover {
    color: var(--primary-color); 
    background-color: #e3f2fd; 
}

h1.title a {
    display: inline-block;
    text-decoration: none;
}

h1.title a img {
    border: none;
    transition: opacity 0.2s;
}

h1.title a:hover img {
    opacity: 0.8;
}

@media (max-width: 800px) {
    .app-logo {
        max-width: 80%;
    }
    .app-container { 
        flex-direction: column; 
    }
    
    .room-wrapper { 
        width: 100%; 
        box-sizing: border-box; 
        min-height: auto;
        height: 80vw;
        max-height: 400px;
        order: -1;
        padding: 10px;
        overflow: hidden;
    }

    .sidebar { 
        width: 100%; 
        box-sizing: border-box; 
        max-height: none; 
    }
    
    #room {
        transform-origin: center center;
        touch-action: none; 
    }

    #selected-controls {
        display: none;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        margin: 0;
        border: none;
        border-top: 1px solid #ddd;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -5px 15px rgba(0,0,0,0.15);
        z-index: 1000;
        box-sizing: border-box;
        animation: slideUp 0.3s ease-out;
    }

    #selected-controls h3 {
        margin-top: 0;
        margin-bottom: 10px;
        font-size: 14px;
        border: none;
        padding: 0;
        text-align: center;
    }

    #selected-controls .input-area-box {
        display: flex;
        gap: 10px;
        background: transparent;
        padding: 0;
        border: none;
        margin-bottom: 10px;
    }
    
    #selected-controls .input-group {
        flex: 1;
        margin-bottom: 10px;
    }

    .control-btns {
        margin-top: 10px;
    }
    
    @keyframes slideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
    
    #selected-controls .input-group {
        min-width: 0;
    }

    #selected-controls .input-group label {
        width: 35px; 
        font-size: 12px;
        white-space: nowrap;
    }

    #selected-controls .input-group input {
        min-width: 0;
        padding: 8px 2px;
        font-size: 14px;
    }
    
} 