/* ============================================================
   AltVeil — Map View Stylesheet
   Full-viewport map layout with sidebar and detail panel
   ============================================================ */

/* ===== Map Page Layout ===== */
.altveil-map-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: #0d0d0d;
}

/* ===== Top Bar ===== */
.altveil-map-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: #111;
    border-bottom: 1px solid #222;
    z-index: 1000;
    flex-shrink: 0;
}

.altveil-map-logo {
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.25rem;
    color: #8b0000;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.altveil-map-logo:hover {
    color: #a00000;
}

.altveil-map-search {
    display: flex;
    flex: 1;
    max-width: 500px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    overflow: visible;
    transition: border-color 0.3s;
    position: relative;
}

.altveil-map-search:focus-within {
    border-color: #8b0000;
}

.altveil-map-search input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    color: #e0e0e0;
    font-size: 0.9rem;
    outline: none;
    min-width: 0;
}

.altveil-map-search input::placeholder {
    color: #666;
}

.altveil-map-search button {
    background: transparent;
    border: none;
    padding: 0.5rem 0.75rem;
    color: #999;
    cursor: pointer;
    font-size: 0.85rem;
    transition: color 0.3s;
}

.altveil-map-search button:hover {
    color: #8b0000;
}

.altveil-map-search button[type="submit"] {
    background: #8b0000;
    color: #e0e0e0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
}

.altveil-map-search button[type="submit"]:hover {
    background: #a00000;
}

.altveil-map-topbar-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ===== Main Content Area ===== */
.altveil-map-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* ===== Left Sidebar ===== */
.altveil-map-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #111;
    border-right: 1px solid #222;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 500;
}

.altveil-sidebar-title {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #999;
    padding: 1rem 1rem 0.75rem;
    margin: 0;
    border-bottom: 1px solid #222;
}

.altveil-category-filters {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

/* Custom scrollbar for sidebar */
.altveil-category-filters::-webkit-scrollbar {
    width: 4px;
}

.altveil-category-filters::-webkit-scrollbar-track {
    background: transparent;
}

.altveil-category-filters::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 2px;
}

.altveil-category-filter {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #ccc;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-family: inherit;
}

.altveil-category-filter:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
}

.altveil-category-filter.active {
    background: rgba(139, 0, 0, 0.12);
    border-color: rgba(139, 0, 0, 0.4);
    color: #e0e0e0;
}

.altveil-category-filter i {
    width: 1.1rem;
    text-align: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.altveil-sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid #222;
    flex-shrink: 0;
}

.altveil-sidebar-count {
    font-size: 0.75rem;
    color: #666;
    margin: 0;
}

/* ===== Map Container ===== */
.altveil-map-container {
    flex: 1;
    min-height: 0;
    z-index: 1;
}

/* ===== Right Detail Panel ===== */
.altveil-place-panel {
    width: 0;
    flex-shrink: 0;
    background: #111;
    border-left: 1px solid #222;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 500;
}

.altveil-place-panel.active {
    width: 380px;
}

.altveil-place-panel .altveil-panel-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #444;
    text-align: center;
    padding: 2rem;
}

.altveil-place-panel .altveil-panel-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Panel content */
.altveil-panel-close {
    position: sticky;
    top: 0;
    float: right;
    background: rgba(17, 17, 17, 0.9);
    border: none;
    color: #999;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.75rem 1rem;
    z-index: 10;
    transition: color 0.2s;
}

.altveil-panel-close:hover {
    color: #fff;
}

.altveil-panel-header {
    padding: 1.25rem 1.25rem 0;
}

.altveil-panel-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.35rem;
    margin: 0 0 0.5rem;
    color: #e0e0e0;
    line-height: 1.3;
}

.altveil-panel-category {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.altveil-panel-category i {
    margin-right: 0.25rem;
}

.altveil-panel-rating {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: #999;
}
.altveil-panel-rating .altveil-stars {
    color: #d4a017;
    letter-spacing: 1px;
}

.altveil-panel-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    margin-top: 1rem;
    display: block;
}

.altveil-panel-body {
    padding: 1.25rem;
}

.altveil-panel-info {
    margin-bottom: 1rem;
}

.altveil-panel-info p {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0 0 0.6rem;
    font-size: 0.85rem;
    color: #bbb;
    line-height: 1.4;
}

.altveil-panel-info p i {
    color: #8b0000;
    width: 1rem;
    text-align: center;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.altveil-panel-info a {
    color: #8b0000;
    word-break: break-all;
}

.altveil-panel-info a:hover {
    color: #a00000;
}

.altveil-panel-desc {
    font-size: 0.85rem;
    color: #999;
    line-height: 1.6;
    border-top: 1px solid #222;
    padding-top: 1rem;
}

/* Panel reviews */
.altveil-panel-reviews {
    padding: 0 1.25rem;
    margin-bottom: 1rem;
}
.altveil-panel-reviews-title {
    font-family: 'Cinzel', serif;
    font-size: .95rem;
    margin: 0 0 .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #e0e0e0;
    padding-bottom: .5rem;
    border-bottom: 1px solid #2a2a2a;
}
.altveil-panel-review-form {
    margin-bottom: 1rem;
}
.altveil-panel-review-form .altveil-star-picker {
    display: flex;
    gap: .25rem;
    margin-bottom: .5rem;
}
.altveil-panel-review-form .altveil-star-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #444;
    cursor: pointer;
    padding: 0 .1rem;
    transition: color .15s, transform .15s;
    line-height: 1;
}
.altveil-panel-review-form .altveil-star-btn:hover,
.altveil-panel-review-form .altveil-star-btn.is-active {
    color: #d4a017;
    transform: scale(1.15);
}
.altveil-panel-review-form textarea {
    width: 100%;
    padding: .6rem .75rem;
    background: #0d0d0d;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    color: #e0e0e0;
    font-family: inherit;
    font-size: .85rem;
    resize: vertical;
    min-height: 60px;
    margin-bottom: .5rem;
    outline: none;
}
.altveil-panel-review-form textarea:focus {
    border-color: #8b0000;
}
.altveil-panel-review-hint {
    color: #666;
    font-size: .8rem;
    margin: 0 0 .75rem;
}
.altveil-panel-review-hint a {
    color: #8b0000;
}
.altveil-panel-review-card {
    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    padding: .75rem;
    margin-bottom: .5rem;
}
.altveil-panel-review-card .altveil-review-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .25rem;
    flex-wrap: wrap;
}
.altveil-panel-review-card .altveil-stars {
    color: #d4a017;
    font-size: .85rem;
    letter-spacing: 1px;
}
.altveil-panel-review-card .altveil-review-author {
    font-weight: 600;
    font-size: .8rem;
    color: #ccc;
}
.altveil-panel-review-card .altveil-review-text {
    color: #999;
    font-size: .8rem;
    line-height: 1.5;
    margin: 0;
}

.altveil-panel-footer {
    display: flex;
    gap: 0.5rem;
    padding: 0 1.25rem 1.25rem;
}

/* ===== Custom Markers ===== */
.altveil-marker-container {
    background: none !important;
    border: none !important;
}

.altveil-marker {
    width: 32px;
    height: 32px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.altveil-marker i {
    transform: rotate(45deg);
    font-size: 0.7rem;
    color: #fff;
}

/* ===== Cluster Markers ===== */
.altveil-cluster {
    background: none !important;
}

.altveil-cluster div {
    width: 36px;
    height: 36px;
    margin: 2px;
    border-radius: 50%;
    background: rgba(139, 0, 0, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(139, 0, 0, 0.4);
}

.altveil-cluster span {
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}

.altveil-cluster-medium div {
    width: 44px;
    height: 44px;
    background: rgba(139, 0, 0, 0.9);
}

.altveil-cluster-medium span {
    font-size: 0.85rem;
}

.altveil-cluster-large div {
    width: 52px;
    height: 52px;
    background: rgba(160, 0, 0, 0.95);
}

.altveil-cluster-large span {
    font-size: 0.95rem;
}

/* ===== Leaflet Dark Theme Overrides ===== */
.altveil-map-container .leaflet-popup-content-wrapper {
    background: #1a1a1a;
    color: #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
    border: 1px solid #333;
}

.altveil-map-container .leaflet-popup-tip {
    background: #1a1a1a;
    border: 1px solid #333;
}

.altveil-map-container .leaflet-popup-close-button {
    color: #999;
}

.altveil-map-container .leaflet-popup-close-button:hover {
    color: #fff;
}

.altveil-map-container .leaflet-control-zoom a {
    background: #1a1a1a;
    color: #e0e0e0;
    border-color: #333;
}

.altveil-map-container .leaflet-control-zoom a:hover {
    background: #2a2a2a;
}

.altveil-map-container .leaflet-control-attribution {
    background: rgba(13, 13, 13, 0.85);
    color: #666;
    font-size: 0.65rem;
}

.altveil-map-container .leaflet-control-attribution a {
    color: #888;
}

/* ===== List View ===== */
.altveil-list-view {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #0d0d0d;
}

.altveil-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

.altveil-list-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.altveil-list-card:hover {
    border-color: #8b0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.altveil-list-card-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: #111;
}

.altveil-list-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.altveil-list-card-body {
    padding: 1.25rem;
    flex: 1;
}

/* Cards without images get top padding via body, balanced min-height */
.altveil-list-card:not(.has-image) .altveil-list-card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.altveil-list-card-header {
    margin-bottom: 0.5rem;
}

.altveil-list-card h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    margin: 0 0 0.35rem;
    color: #e0e0e0;
}

.altveil-list-card-location {
    font-size: 0.8rem;
    color: #999;
    margin: 0 0 0.5rem;
}

.altveil-list-card-location i {
    color: #8b0000;
    margin-right: 0.25rem;
}

.altveil-list-card-desc {
    font-size: 0.85rem;
    color: #777;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== Loading Overlay ===== */
.altveil-map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 800;
    background: rgba(13, 13, 13, 0.85);
    padding: 1.5rem 2rem;
    border-radius: 8px;
    color: #999;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    pointer-events: none;
}

.altveil-map-loading .altveil-spinner {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

/* ===== Responsive: Tablet ===== */
@media (max-width: 1024px) {
    .altveil-place-panel.active {
        width: 320px;
    }

    .altveil-map-sidebar {
        width: 220px;
    }
}

/* ===== Responsive: Mobile ===== */
@media (max-width: 768px) {
    .altveil-map-topbar {
        flex-wrap: wrap;
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .altveil-map-logo {
        font-size: 1rem;
    }

    .altveil-map-search {
        order: 3;
        flex-basis: 100%;
        max-width: none;
    }

    .altveil-map-topbar-actions {
        margin-left: auto;
    }

    /* Sidebar becomes a bottom sheet on mobile */
    .altveil-map-content {
        flex-direction: column;
    }

    .altveil-map-sidebar {
        width: 100%;
        height: auto;
        max-height: 0;
        border-right: none;
        border-bottom: 1px solid #222;
        transition: max-height 0.35s ease;
        overflow: hidden;
    }

    .altveil-map-sidebar.open {
        max-height: 50vh;
        overflow-y: auto;
    }

    .altveil-category-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        padding: 0.5rem;
    }

    .altveil-category-filter {
        flex: 0 0 auto;
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    .altveil-sidebar-footer {
        display: none;
    }

    .altveil-sidebar-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        padding: 0.75rem 1rem;
    }

    .altveil-sidebar-title::after {
        content: '\25BC';
        font-size: 0.7rem;
        color: #666;
    }

    /* Detail panel becomes full-screen overlay on mobile */
    .altveil-place-panel {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 0;
        border-left: none;
        z-index: 2000;
    }

    .altveil-place-panel.active {
        width: 100%;
    }

    /* List view */
    .altveil-list-view {
        padding: 1rem;
    }

    .altveil-list-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== No Results State ===== */
.altveil-map-no-results {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 800;
    background: rgba(26, 26, 26, 0.95);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border: 1px solid #333;
    color: #999;
    font-size: 0.9rem;
    text-align: center;
    pointer-events: none;
    animation: av-fadeInUp 0.3s ease-out;
}

@keyframes av-fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Mobile sidebar toggle button */
.altveil-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 900;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    color: #e0e0e0;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .altveil-sidebar-toggle {
        display: flex;
    }
}
