/* ==================== OpenLayers Map Styles — Piatra Neamț Model ====================  */
/* Parko Mobility — Huși Parking System */

/* ===== MAP LAYOUT ===== */
.ol-map-wrapper {
    position: relative;
    width: 100%;
    height: calc(100vh - 120px);
    min-height: 500px;
}

.ol-map {
    width: 100%;
    height: 100%;
    background: #1a2332;
}

/* ===== TOP BAR ===== */
.map-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    z-index: 100;
    position: relative;
}

.topbar-left { flex: 1; max-width: 400px; }
.topbar-center { display: flex; align-items: center; gap: 6px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

/* ===== SEARCH ===== */
.search-container {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 8px 36px 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    border-color: #2E86DE;
    box-shadow: 0 0 0 3px rgba(46,134,222,0.12);
}

.search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 13px;
}

.search-clear {
    position: absolute;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
    display: none;
}

.search-clear:hover { color: #e74c3c; }

.search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    max-height: 280px;
    overflow-y: auto;
    z-index: 200;
    margin-top: 4px;
    list-style: none;
    padding: 4px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
}

.search-result-item:hover { background: #f0f7ff; }

.search-result-item .search-type {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.search-type.proposed { background: #2E86DE; }
.search-type.existing { background: #27ae60; }

.search-result-item div { display: flex; flex-direction: column; }
.search-result-item strong { font-size: 12px; color: #1a2332; }
.search-result-item small { font-size: 11px; color: #64748b; }

.no-results {
    padding: 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
}

/* ===== TOOLBAR BUTTONS ===== */
.tool-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #475569;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
}

.tool-btn:hover {
    background: #f0f7ff;
    border-color: #2E86DE;
    color: #2E86DE;
}

.tool-btn .btn-label { font-size: 12px; }

.measure-result {
    padding: 5px 12px;
    background: #2E86DE;
    color: #fff;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

/* ===== FLOATING MAP CONTROLS ===== */
.map-controls-floating {
    position: absolute;
    right: 16px;
    bottom: 80px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 50;
}

.map-controls-floating button {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 8px;
    background: #fff;
    color: #1a2332;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-controls-floating button:hover {
    background: #2E86DE;
    color: #fff;
    transform: scale(1.05);
}

/* ===== COORDINATE DISPLAY ===== */
.coord-display {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(255,255,255,0.92);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-family: 'Inter', monospace;
    color: #475569;
    z-index: 50;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* ===== MAP STATS BAR ===== */
.map-stats-bar {
    position: absolute;
    bottom: 8px;
    right: 70px;
    display: flex;
    gap: 16px;
    background: rgba(255,255,255,0.92);
    padding: 6px 14px;
    border-radius: 6px;
    z-index: 50;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-num {
    font-size: 14px;
    font-weight: 700;
    color: #1a2332;
}

.stat-lbl {
    font-size: 9px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== SIDEBAR PANELS ===== */
.sidebar-panel {
    position: fixed;
    top: 120px;
    right: 0;
    width: 280px;
    max-height: calc(100vh - 140px);
    background: #fff;
    border-left: 1px solid #e2e8f0;
    box-shadow: -4px 0 16px rgba(0,0,0,0.08);
    z-index: 150;
    overflow-y: auto;
    border-radius: 0 0 0 12px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    font-size: 14px;
    color: #1a2332;
}

.sidebar-header i { margin-right: 6px; color: #2E86DE; }

.sidebar-close {
    border: none;
    background: none;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
}

.sidebar-close:hover { color: #e74c3c; }

.sidebar-body {
    padding: 14px 16px;
}

.sidebar-body h5 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    margin-bottom: 10px;
    margin-top: 4px;
}

.sidebar-body hr {
    border: none;
    border-top: 1px solid #f1f5f9;
    margin: 12px 0;
}

.layer-check, .layer-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 12px;
    color: #334155;
    cursor: pointer;
}

.layer-check input, .layer-radio input {
    accent-color: #2E86DE;
}

/* ===== LEGEND ROWS ===== */
.legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    color: #475569;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.legend-line {
    width: 20px;
    height: 0;
    border-top: 3px dashed;
    flex-shrink: 0;
}

/* ===== APP MENU ===== */
.app-menu {
    position: fixed;
    top: 120px;
    right: 16px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    z-index: 160;
    overflow: hidden;
    min-width: 200px;
}

.app-menu ul {
    list-style: none;
    padding: 6px;
    margin: 0;
}

.app-menu li {
    padding: 10px 16px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-menu li:hover {
    background: #f0f7ff;
    color: #2E86DE;
}

.app-menu li i { width: 18px; text-align: center; }

/* ===== POPUP STYLES ===== */
.ol-popup {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    padding: 0;
    min-width: 260px;
    max-width: 340px;
    z-index: 100;
}

.ol-popup:after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    width: 16px;
    height: 16px;
    background: #fff;
    transform: translateX(-50%) rotate(45deg);
    box-shadow: 2px 2px 4px rgba(0,0,0,0.08);
}

.ol-popup-closer {
    position: absolute;
    top: 8px;
    right: 10px;
    text-decoration: none;
    color: #94a3b8;
    font-size: 18px;
    font-weight: 700;
    z-index: 10;
}

.ol-popup-closer:hover { color: #e74c3c; }
.ol-popup-closer:after { content: "\2715"; }

.ol-popup-inner {
    padding: 16px;
    font-family: 'Inter', sans-serif;
}

.ol-popup-inner h4 {
    font-size: 14px;
    font-weight: 700;
    color: #1a2332;
    margin: 8px 0 10px;
}

.zone-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    padding: 3px 10px;
    border-radius: 12px;
}

.zone-badge.proposed {
    background: rgba(46,134,222,0.12);
    color: #2E86DE;
}

.zone-badge.existing {
    background: rgba(39,174,96,0.12);
    color: #27ae60;
}

.popup-table {
    width: 100%;
    font-size: 12px;
    border-collapse: collapse;
}

.popup-table td {
    padding: 4px 6px;
    color: #475569;
    vertical-align: top;
}

.popup-table td:first-child {
    width: 90px;
    color: #64748b;
}

.popup-desc {
    font-size: 11px;
    color: #64748b;
    margin-top: 8px;
    line-height: 1.5;
}

.popup-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.feat-tag {
    font-size: 10px;
    font-weight: 500;
    padding: 3px 8px;
    background: rgba(46,134,222,0.08);
    color: #2E86DE;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.feat-tag.neg {
    background: #FDE8E8;
    color: #e74c3c;
}

.popup-features.negative .feat-tag {
    background: #FDE8E8;
    color: #e74c3c;
}

/* Spot status */
.spot-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.spot-status.free { background: rgba(46,204,113,0.15); color: #27ae60; }
.spot-status.occupied { background: rgba(231,76,60,0.15); color: #c0392b; }
.spot-status.reserved { background: rgba(241,196,15,0.15); color: #b7791f; }

.btn-reserve {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 8px;
    background: #2E86DE;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-reserve:hover { background: #1a6fbe; }

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-header-custom {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
}

.modal-header-custom h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1a2332;
    line-height: 1.3;
}

.modal-logo {
    width: 48px;
    height: 48px;
    font-size: 20px;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    border: none;
    background: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
}

.modal-close:hover { color: #e74c3c; }

.modal-body-custom {
    padding: 20px 24px;
}

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

.tariff-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px;
}

.tariff-card h5 {
    font-size: 12px;
    font-weight: 700;
    color: #1a2332;
    margin-bottom: 8px;
}

.tariff-card p {
    font-size: 11px;
    color: #475569;
    margin: 4px 0;
}

.modal-info {
    background: #f0f7ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}

.modal-info p {
    font-size: 12px;
    color: #1e40af;
    margin: 0;
}

.modal-info i { margin-right: 6px; }

.legend-preview {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 12px 0;
}

.legend-preview span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #475569;
}

.btn-primary-full {
    display: block;
    width: 100%;
    padding: 12px;
    background: #2E86DE;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: background 0.2s;
    font-family: 'Inter', sans-serif;
}

.btn-primary-full:hover { background: #1a6fbe; }

.reserve-info {
    background: #f8fafc;
    border-radius: 8px;
    padding: 14px;
    margin: 12px 0;
}

.reserve-info p { font-size: 12px; color: #475569; margin: 4px 0; }
.reserve-info i { color: #2E86DE; margin-right: 6px; }

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}

.btn-primary, .btn-secondary {
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    border: 1px solid transparent;
}

.btn-primary {
    background: #2E86DE;
    color: #fff;
}

.btn-primary:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

.btn-secondary:hover { background: #e2e8f0; }

/* ===== COMPACT FOOTER ===== */
.compact-footer {
    padding: 12px 0;
}

.compact-footer .footer-content {
    padding: 8px 24px;
}

/* ===== OL POPUP VISIBILITY ===== */

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .ol-map-wrapper { height: calc(100vh - 160px); }
    .map-topbar { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
    .topbar-left { max-width: 100%; flex-basis: 100%; order: 1; }
    .topbar-center { order: 3; flex-basis: 100%; justify-content: center; }
    .topbar-right { order: 2; }
    .sidebar-panel { width: 100%; top: 160px; right: 0; border-radius: 0; }
    .map-stats-bar { right: 8px; left: 8px; justify-content: space-around; bottom: 4px; }
    .coord-display { display: none; }
    .tariff-grid { grid-template-columns: 1fr; }
    .tool-btn .btn-label { display: none; }
}

/* ===== OL OVERRIDES ===== */
.ol-scale-line {
    background: rgba(255,255,255,0.85);
    border-radius: 4px;
    padding: 2px 6px;
    bottom: 36px;
}

.ol-full-screen {
    top: auto;
    bottom: 130px;
    right: 16px;
}

.ol-full-screen button {
    border-radius: 8px;
    background: #fff;
    color: #1a2332;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.ol-attribution {
    font-size: 10px;
    background: rgba(255,255,255,0.7);
    border-radius: 4px;
}
