:root {
    --ikea-blue: #0051ba;
    --ikea-yellow: #ffda1a;
    --bg-gray: #f5f5f7;
    --border-color: #e5e5e5;
    --text-primary: #111111;
    --text-muted: #484848;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
}

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

body {
    font-family: 'Noto Sans', sans-serif;
    background-color: white;
    color: var(--text-primary);
}

.planner-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Top Nav */
.planner-nav {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: white;
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

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

.logo {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--ikea-blue);
    text-transform: uppercase;
}

.page-title {
    color: var(--text-muted);
    font-size: 0.875rem;
    padding-left: 12px;
    border-left: 1px solid var(--border-color);
}

.view-controls {
    display: flex;
    background: var(--bg-gray);
    padding: 4px;
    border-radius: 32px;
}

.btn-view {
    padding: 8px 20px;
    border: none;
    background: transparent;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: 20px;
    transition: 0.2s;
}

.btn-view.active {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.action-controls {
    display: flex;
    gap: 12px;
}

.btn-primary {
    background: var(--ikea-blue);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #004299;
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
}

.btn-secondary:hover {
    background: var(--bg-gray);
}

/* Layout */
.planner-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.planner-sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
    overflow: auto;
}

.sidebar-header h3 {
    font-size: 1.125rem;
    margin-bottom: 4px;
}

.sidebar-header p {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-bottom: 24px;
}

.furniture-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.furniture-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: grab;
    transition: 0.2s;
    background: white;
}

.furniture-item:hover {
    box-shadow: var(--shadow);
    border-color: var(--ikea-blue);
}

.furniture-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: var(--ikea-blue);
    font-size: 1.25rem;
}

.furniture-info .name {
    display: block;
    font-weight: 700;
    font-size: 0.813rem;
}

.furniture-info .dims {
    display: block;
    font-size: 0.688rem;
    color: var(--text-muted);
}

.sidebar-help {
    margin-top: 24px;
    padding: 12px;
    background: #e7f0ff;
    border-radius: 8px;
    font-size: 0.688rem;
    color: #1a4a99;
}

/* Properties Panel */
.sidebar-properties {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.prop-group h4, #obj-properties h4 {
    font-size: 0.813rem;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.prop-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.input-wrap label {
    display: block;
    font-size: 0.625rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.input-wrap input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.875rem;
    outline: none;
}

.input-wrap input:focus {
    border-color: var(--ikea-blue);
}

.btn-danger {
    width: 100%;
    margin-top: 12px;
    background: #e00707;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.813rem;
    cursor: pointer;
}

.btn-danger:hover {
    background: #bf0606;
}

hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 20px 0;
}

/* Workspace */
.planner-workspace {
    flex: 1;
    position: relative;
    background: var(--bg-gray);
}

.canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
}

.canvas-container.active {
    display: block;
}

.canvas-overlay {
    position: absolute;
    bottom: 24px;
    right: 24px;
    pointer-events: none;
}

.room-stats {
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.mode-controls {
    display: flex;
    gap: 10px;
    margin: 10px 0 20px 0;
}

.btn-mode {
    flex: 1;
    padding: 10px;
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.813rem;
    font-weight: 700;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-mode.active {
    background: var(--ikea-blue);
    color: white;
    border-color: var(--ikea-blue);
}

.input-group label {
    display: block;
    font-size: 0.813rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-muted);
}
.btn-danger-outline {
    background: transparent;
    color: #e00707;
    border: 1px solid #e00707;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-danger-outline:hover {
    background: #e00707;
    color: white;
}
/* Mobile Restriction Styles */
#mobile-restriction {
    display: none;
    height: 100vh;
    width: 100%;
    background: white;
    padding: 40px;
    text-align: center;
    align-items: center;
    justify-content: center;
}

.restriction-content {
    max-width: 400px;
}

.restriction-content i {
    font-size: 4rem;
    color: var(--ikea-blue);
    margin-bottom: 24px;
}

.restriction-content h2 {
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.restriction-content p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* Response Breakpoint: Hide app on small mobiles ( < 768px ) */
@media (max-width: 767px) {
    .planner-app {
        display: none !important;
    }
    #mobile-restriction {
        display: flex;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.designs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.design-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s;
}

.design-card:hover {
    border-color: var(--ikea-blue);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.design-card h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-color);
}

.design-card .meta {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.btn-load {
    width: 100%;
    padding: 8px;
    background: var(--ikea-blue);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.btn-load:hover {
    background: #004299;
}
