/* ========================================
   GLOBAL STYLES
======================================== */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Arial, sans-serif;
}

/* ========================================
   HEADER / BANNER
======================================== */
#banner {
    background: #333;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    height: 60px;
    width: 100%;
}

#logo-left, #logo-right {
    height: 50px;
}

#logo-right {
    margin-left: auto;
    margin-right: 40px;
}

/* ========================================
   LAYOUT
======================================== */

#main-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

#top-section {
    flex: 1 1 auto;
    display: flex;
    width: 100%;
    height: 100%;
}

#container {
    display: flex;
    flex: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#sidebar {
    width: 30%;
    min-width: 280px; /* optional */
    background: #f4f4f4;
    padding: 15px;
    overflow-y: auto;
}

#map {
    flex: 1;
    height: 100%;
    width: 70%;
}

/* ========================================
   DETAIL PANEL
======================================== */

#detail-panel {
    flex-shrink: 0;
    background: white;
    border-top: 1px solid #ccc;
    padding: 20px;
    height: 250px;
    display: none; /* Hidden by default */
    width: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.1);
    z-index: 999;
}

#detail-panel.visible {
    display: block;
}

#detail-tabs {
    display: flex;
    border-bottom: 1px solid #ccc;
    margin-bottom: 10px;
}

.tab-button {
    background: #f1f1f1;
    border: 1px solid #ccc;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    padding: 6px 12px;
    margin-right: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: background 0.2s ease;
}

.tab-button.active {
    background: white;
    border-bottom: 1px solid white;
}

.tab-button:hover {
    background: #e6e6e6;
}

.tab-section {
    display: none;
    padding-top: 10px;
}

.tab-section.active {
    display: block;
}

#detail-content {
    position: relative;
    padding: 0 16px;
    max-width: 100%;
}

#detail-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #888;
}

#detail-close:hover {
    color: red;
}

/* ========================================
   SIDEBAR: Collapsible Sections
======================================== */

.sidebar-section {
    margin-bottom: 20px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 12px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 4px 0;
    user-select: none;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 18px;
}

.sidebar-header i {
    font-size: 14px;
    transition: transform 0.2s ease;
}

.sidebar-content {
    display: block;
    margin-top: 10px;
}

.sidebar-section.collapsed .sidebar-content {
    display: none;
}

.sidebar-section.collapsed .sidebar-header i {
    transform: rotate(-90deg);
}

/* ========================================
   SEARCH RESULTS
======================================== */
.card-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border: 1px solid #ccc;
    background: #f9f9f9;
    border-radius: 4px;
}

.add-button {
    padding: 0.25rem 0.5rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

#search-results:empty {
    padding: 0;
    border: none;
    background: none;
}

.empty-message {
    padding: 8px;
    font-style: italic;
    color: #666;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 4px;
}

/* Legacy (can be phased out if unused) */
.card-stack.results {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 5px;
    border-radius: 4px;
    background: #fff;
}

.result-card {
    background: #f9f9f9;
    padding: 8px;
    margin-bottom: 6px;
    border-radius: 4px;
    border: 1px solid #ccc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-card .info {
    font-size: 14px;
}

.result-card button {
    background: #007bff;
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.result-card button:hover {
    background: #0056b3;
}

/* ========================================
   URBANITY CARDS (Selection)
======================================== */
.card-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 5px;
    overflow-y: auto;
    max-height: calc(100% - 40px);
}

.card {
    background: white;
    border: 1px solid #ccc;
    padding: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.card:hover {
    background: #e6f2ff;
}

/* ========================================
   BUTTONS & INTERACTIVE CONTROLS
======================================== */
.toggle-button {
    display: block;
    margin-bottom: 10px;
    padding: 6px 12px;
    font-size: 14px;
    background: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}

.toggle-button.active {
    background: #0056b3;
}

.toggle-button.secondary {
    background: #6c757d;
}

.toggle-button.secondary:hover {
    background: #5a6268;
}

.remove-button {
    background: none;
    border: none;
    color: #999;
    font-size: 16px;
    cursor: pointer;
}

.remove-button:hover {
    color: red;
}

/* ========================================
   ICON BUTTON GROUP
======================================== */
.icon-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.icon-button {
    background: none;
    border: none;
    color: #333;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.icon-button:hover {
    background: #dcdcdc;
}

.icon-button.active {
    background: #007bff;
    color: white;
}

/* ========================================
   INFO BOXES
======================================== */
.info-box {
    padding: 10px;
    border: 1px solid #ccc;
    background: white;
    margin-bottom: 10px;
}

/* ========================================
   MISC UTILITY
======================================== */
.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}



