/**
 * Office Building Presentation - Main Styles
 * Professional layout with sidebars, overlays, Swedbank-inspired palette
 */

:root {
    --color-bg: #ffffff;
    --color-bg-warm: #F8F3EB;
    --color-accent: #ff5f00;
    --color-accent-dark: #ff5f00;
    --color-text: #512b2b;
    --color-text-muted: #666;
    --color-border: #e0dcd4;
    --sidebar-width: 320px;
    --header-height: 56px;
    --bottom-bar-height: 72px;
    --radius: 8px;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    color: var(--color-text);
    background: var(--color-bg);
}

body.login-page {
    overflow: auto;
}

/* =============================================================================
   LOGIN PAGE
   ============================================================================= */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-warm);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    max-width: 180px;
    height: auto;
}

.login-brand {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--color-accent);
    margin: 0.5rem 0 0;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #ff5f00;
}

.login-form input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: box-shadow 0.3s ease-in-out;
}

.login-form input:focus {
    outline: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.login-error {
    color: #c0392b;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #fdeaea;
    border-radius: var(--radius);
}

/* =============================================================================
   BUTTONS
   ============================================================================= */

.btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

.btn-primary {
    background: var(--color-accent);
    color: white;
}

.btn-primary:hover {
    background: var(--color-accent-dark);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-ghost:hover {
    background: var(--color-bg-warm);
}

/* =============================================================================
   MAIN HEADER
   ============================================================================= */

.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    z-index: 100;
}

.main-header.compact .header-logo {
    height: 24px;
}

.header-logo {
    height: 28px;
    display: block;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-accent);
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

/* =============================================================================
   FLOOR SELECTOR LAYOUT
   ============================================================================= */

.floor-selector-page {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    padding-top: var(--header-height);
    /*padding-bottom: var(--bottom-bar-height);*/
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.floor-selector-main {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Visualizer (left/main area) */
.visualizer-section {
    position: relative;
    flex: 1;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    min-height: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    background: white;
    overflow: hidden;
}

.visualizer-section canvas,
.visualizer-section img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.visualizer-section img {
    position: absolute;
    top: 0;
    left: 0;
}

.product-viewer {
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    flex: 1;
    position: relative;
    cursor: grab;
    user-select: none;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: #f9f9f9;
}

.product-viewer:active {
    cursor: grabbing;
}

.product-viewer img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
}

.loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    color: var(--color-text-muted);
    z-index: 10;
}

.loader.hidden {
    display: none;
}

/* =============================================================================
   RIGHT SIDEBAR - Floor / Room selection
   ============================================================================= */

.right-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--color-bg-warm);
    border-left: 1px solid var(--color-border);
    padding: 1.5rem;
    overflow-y: auto;
}

.sidebar-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-accent);
    margin: 0 0 1.25rem;
}

.floor-nav,
.room-nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.floor-card,
.room-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.25rem;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: box-shadow 0.2s, border-color 0.2s;
    font-size: 1rem;
    text-align: left;
    text-decoration: none;
    color: inherit;
}

.floor-card:hover,
.room-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--color-accent);
}

.floor-card.active,
.room-card.active {
    border-color: var(--color-accent);
    background: rgba(229, 120, 43, 0.08);
}

.floor-card-title,
.room-card-title {
    font-weight: 500;
}

.floor-card-arrow,
.room-card-arrow {
    color: var(--color-text-muted);
    font-size: 1.25rem;
}

.room-empty {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* =============================================================================
   BOTTOM CONTROLS
   ============================================================================= */

.bottom-controls {
    position: fixed;
    bottom: 10px;
    left: 42%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: white;
    border-radius: 50px;
    box-shadow: var(--shadow-hover);
    border: 1px solid var(--color-border);
    z-index: 100;
    margin-bottom: 0.5rem;
}
@media (max-width: 900px) {
    .bottom-controls {
        left: 50%;
    }
}

.btn-nav {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #ffffff;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-nav:hover {
    background: var(--color-accent);
    color: white;
}

.floor-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-accent);
    text-decoration: none;
    padding: 0 0.5rem;
    min-width: 140px;
    text-align: center;
}

.floor-title:hover {
    text-decoration: underline;
}

/* =============================================================================
   3D VIEWER PAGE
   ============================================================================= */

.viewer3d-page {
    overflow: hidden;
    height: 100vh;
}

.viewer3d-page .main-header {
    position: absolute;
}

#viewer3d-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.viewer3d-page .right-sidebar {
    position: fixed;
    top: var(--header-height);
    right: 0;
    bottom: 0;
    width: var(--sidebar-width);
    z-index: 50;
}

/* Pointer lock overlay */
.pointer-lock-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    z-index: 200;
    transition: opacity 0.3s;
}

.pointer-lock-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.pointer-lock-overlay p {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.pointer-lock-overlay span {
    font-size: 0.95rem;
    opacity: 0.9;
}
