:root {
    --primary-color: #B31B1B;
    --secondary-color: #EAEAEA;
    --background-dark: #0F0F0F;
    --background-light: #1A1A1A;
    --text-muted: #888888;
    --button-hover: #e33030;
    --canvas-border: #444;
    --menu-width: 250px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-dark);
    color: var(--secondary-color);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ---------------------------------------------------- */
/* HEADER & NAVIGATION */
/* ---------------------------------------------------- */

.header {
    background-color: var(--primary-color);
    color: var(--background-dark);
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.header h1 {
    color: var(--background-dark);
    margin: 0 0 5px 0;
}

.header p {
    margin: 0 0 10px 0;
    font-size: 0.9em;
}

.nav-link {
    color: var(--background-dark);
    text-decoration: none;
    font-weight: bold;
    padding: 5px 10px;
    border: 1px solid var(--background-dark);
    border-radius: 4px;
    transition: background-color 0.2s;
}

.nav-link:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* ---------------------------------------------------- */
/* MAIN CONTENT & 3-COLUMN LAYOUT */
/* ---------------------------------------------------- */

.main-content {
    display: flex;
    max-width: 1600px;
    margin: 30px auto;
    gap: 20px;
    padding: 0 20px;
    align-items: stretch;
    min-height: calc(100vh - 100px);
}

/* ---------------------------------------------------- */
/* CONTROL PANELS (Left and Right Menus) */
/* ---------------------------------------------------- */

.control-panel {
    background-color: var(--background-light);
    color: var(--secondary-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 20px;
    width: var(--menu-width);
    flex-shrink: 0;
}

.control-panel h2 {
    color: var(--primary-color);
    font-size: 1.3em;
    margin-top: 0;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

.input-group {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.input-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
}

.input-group-vertical label {
    font-size: 0.95em;
    color: var(--text-muted);
}

.input-group-vertical h3 {
    color: var(--secondary-color);
    font-size: 1.1em;
    margin: 5px 0 0 0;
}


.control-panel input[type="number"],
.control-panel input[type="text"],
.control-panel .selector,
#rotation-slider {
    background-color: #333;
    border: 1px solid #555;
    color: var(--secondary-color);
    padding: 8px;
    border-radius: 4px;
    width: 100%;
}

.control-panel button {
    width: 100%;
    padding: 10px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    margin-top: 10px;
    transition: background-color 0.2s;
}

.control-panel button:hover:not(:disabled) {
    background-color: var(--button-hover);
}

.control-panel button:disabled {
    background-color: #555;
    cursor: not-allowed;
}

.danger-button {
    background-color: #cc0000 !important;
}

.danger-button:hover {
    background-color: #ff3333 !important;
}

hr {
    border: 0;
    border-top: 1px solid #333;
    margin: 20px 0;
}

/* ---------------------------------------------------- */
/* CANVAS AREA (CENTRAL) */
/* ---------------------------------------------------- */

#planner-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 10px;
    background-color: var(--background-light);
    border-radius: 8px;
    min-height: 100%;
}

#room-canvas {
    border: 2px dashed var(--canvas-border);
    background-color: #222;
    cursor: grab;
    touch-action: none;
    width: 100%;
    height: 100%;
    margin-top: 0;
    margin-bottom: 10px;
}

#controls-section {
    width: 100%;
    padding: 10px;
    background-color: #222;
    border-radius: 4px;
    border: 1px solid #333;
    margin-top: 10px;
}

#scale-info {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.9em;
    text-align: center;
}

/* ---------------------------------------------------- */
/* FOOTER */
/* ---------------------------------------------------- */
.site-footer {
    background: linear-gradient(180deg, #0b0b0b 0%, #111111 100%);
    border-top: 1px solid #222;
    color: var(--secondary-color);
    padding: 26px 20px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.footer-brand h3 {
    margin: 0 0 6px 0;
    color: var(--secondary-color);
    font-size: 1.25rem;
}

.footer-tagline {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-nav {
    display: flex;
    gap: 12px;
    align-items: center;
}

.footer-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.15s, transform 0.12s;
    background: transparent;
}

.footer-link:hover {
    background: rgba(179, 27, 27, 0.12);
    transform: translateY(-2px);
}

.footer-legal {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.socials {
    display: flex;
    gap: 8px;
}

.social-link {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: transform 0.12s, box-shadow 0.12s;
}

.social-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(179, 27, 27, 0.18);
}

.copyright {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ---------------------------------------------------- */
/* RESPONSIVE DESIGN */
/* ---------------------------------------------------- */

@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
        gap: 20px;
        margin: 20px auto;
        padding: 0 10px;
        min-height: auto;
    }

    .control-panel {
        position: static;
        width: 100%;
        max-width: none;
        order: -1;
    }

    #planner-area {
        min-height: 400px;
        width: 100%;
    }

    #controls-section {
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }
}