:root {
    --primary-color: #3f51b5;
    /* Indigo */
    --secondary-color: #f5f5f5;
    /* Light Grey */
    --accent-color: #ff4081;
    /* Pink */
    --text-color: #333;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans KR', sans-serif;
}

body {
    margin: 0;
    overflow: hidden;
    font-family: 'Noto Sans KR', sans-serif;
    background-color: #ffffff;
    /* Brighter background */
}

/* ADMIN PANEL STYLES */
#admin-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 300px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    display: none;
    /* Hidden by default */
    z-index: 2000;
    max-height: 90vh;
    overflow-y: auto;
}

#admin-panel.active {
    display: block;
}

#admin-panel h2 {
    margin-top: 0;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.admin-group {
    margin-bottom: 15px;
}

.admin-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9rem;
}

.admin-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.admin-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.admin-btn {
    flex: 1;
    padding: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.admin-btn:hover {
    background: #303f9f;
}

.admin-btn.danger {
    background: #e74c3c;
}

.admin-btn.danger:hover {
    background: #c0392b;
}

.admin-btn.success {
    background: #2ecc71;
}

.admin-btn.success:hover {
    background: #27ae60;
}


#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
}

/* --- PREMIUM UI STYLES --- */

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

header {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 20px 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border-radius: 0 0 20px 20px;
    margin: 0 20px;
    margin-top: 10px;
    max-width: 400px;
    align-self: flex-start;
    transition: all 0.3s ease;
}

#floor-selector {
    pointer-events: auto;
    position: absolute;
    top: 20px;
    left: 450px;
    /* Position to the right of header */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 10px;
}

.floor-btn {
    border: none;
    background: transparent;
    padding: 10px 20px;
    font-size: 1.1rem;
    font-weight: 800;
    color: #aaa;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.floor-btn:hover {
    color: #666;
    background: rgba(0, 0, 0, 0.05);
}

.floor-btn.active {
    background: #3f51b5;
    color: white;
    box-shadow: 0 4px 10px rgba(63, 81, 181, 0.3);
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: #1a1a1a;
    font-weight: 700;
    letter-spacing: -0.5px;
}

header p {
    margin: 5px 0 0 0;
    font-size: 0.9rem;
    color: #666;
}

#controls {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-left: 1px solid rgba(255, 255, 255, 0.5);
    width: 320px;
    height: 100%;
    position: absolute;
    right: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.05);
    padding: 20px;
    box-sizing: border-box;
}

#location-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
    /* Allow wrapping */
}

.category-btn {
    padding: 8px 16px;
    border: none;
    background: #f0f2f5;
    color: #666;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.category-btn.active {
    background: #3f51b5;
    color: white;
    box-shadow: 0 4px 12px rgba(63, 81, 181, 0.3);
    transform: translateY(-1px);
}

.category-btn:hover:not(.active) {
    background: #e0e0e0;
}

#locations-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

/* Custom Scrollbar */
#locations-list::-webkit-scrollbar {
    width: 6px;
}

#locations-list::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

#locations-list::-webkit-scrollbar-track {
    background: transparent;
}

.location-item {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.03);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.location-item:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
    border-color: rgba(63, 81, 181, 0.1);
}

.location-item h4 {
    margin: 0;
    font-size: 1rem;
    color: #333;
    font-weight: 600;
}

.room-number {
    font-size: 0.75rem;
    font-weight: 700;
    color: #3f51b5;
    background: #e8eaf6;
    padding: 4px 8px;
    border-radius: 6px;
}

/* Admin Toggle Hint (Invisible but clickable) */
header:active {
    /* Subtle feedback */
    transform: scale(0.98);
}


#info-panel {
    position: absolute;
    bottom: 40px;
    left: 40px;
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
    width: 320px;
    transform-origin: bottom left;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#info-panel.hidden {
    transform: scale(0.9);
    opacity: 0;
    pointer-events: none;
    display: block;
    /* Keep layout but hide visually */
}

#info-panel h2 {
    color: var(--primary-color);
    margin-bottom: 8px;
    font-size: 1.3rem;
}

#reset-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
}

#reset-btn:hover {
    background: #7f8c8d;
}