/**
 * Destinations Map - Frontend Styles
 */

:root {
    --dm-primary: #009640;
    --dm-primary-light: rgba(0, 150, 64, 0.1);
    --dm-text: #333;
    --dm-text-light: #666;
    --dm-border: #e0e0e0;
    --dm-radius: 15px;
    --dm-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

/* Popup Override */
.leaflet-popup {
    bottom: 23px !important;
}

.leaflet-popup-content-wrapper {
    border-radius: 12px;
}

.leaflet-popup-content {
    margin: 12px 15px;
}

/* Main Wrapper */
.dm-wrap {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Layout */
.dm-layout-locator {
    display: flex;
    gap: 24px;
    align-items: stretch;
}

/* Sidebar */
.dm-side {
    width: 380px;
    min-width: 380px;
    background: var(--dm-primary);
    border-radius: var(--dm-radius);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: relative;
    order: 2;
    max-height: 800px;
}

/* Category List */
.dm-cat-list {
    padding: 20px 20px 10px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dm-cat-item {
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 90px;
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dm-cat-item:hover {
    background: rgba(255,255,255,0.15);
    border-color: #fff;
}

.dm-cat-item.active {
    background: #fff;
    color: var(--dm-primary);
    border-color: #fff;
    font-weight: 600;
}

.dm-cat-item .dm-cat-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.dm-cat-item .dm-cat-code {
    font-size: 11px;
    text-transform: uppercase;
    opacity: 0.7;
    margin-left: auto;
}

.dm-cat-item .dm-cat-count {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
    margin-left: auto;
}

.dm-cat-item.active .dm-cat-count {
    background: var(--dm-primary);
    color: #fff;
}

/* Destination List */
.dm-dest-list {
    flex: 1;
    overflow: auto;
    padding: 10px 20px 80px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dm-dest-item {
    border-radius: 12px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.12);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dm-dest-item:hover {
    background: rgba(255,255,255,0.25);
    transform: translateX(5px);
}

.dm-dest-item.active {
    background: #fff;
    color: var(--dm-primary);
}

.dm-dest-item .dm-dest-type {
    font-size: 11px;
    opacity: 0.7;
    margin-left: auto;
}

.dm-dest-empty {
    font-size: 14px;
    opacity: 0.7;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Copyright */
.dm-copy {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 20px;
    background: var(--dm-primary);
    border-bottom-left-radius: var(--dm-radius);
    border-bottom-right-radius: var(--dm-radius);
    font-size: 13px;
    opacity: 0.8;
}

/* Map Column */
.dm-map-col {
    position: relative;
    flex: 1 1 auto;
    order: 1;
}

/* Map */
.dm-map {
    width: 100%;
    height: 700px;
    border-radius: var(--dm-radius);
    overflow: hidden;
    box-shadow: var(--dm-shadow);
}

/* Info Card */
.dm-card {
    position: absolute;
    left: 20px;
    bottom: 20px;
    background: #fff;
    border-radius: var(--dm-radius);
    padding: 24px;
    box-shadow: var(--dm-shadow);
    min-width: 340px;
    max-width: 420px;
    display: none;
    z-index: 500;
}

.dm-card.show {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: dm-slideUp 0.3s ease;
}

@keyframes dm-slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dm-card .dm-card-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #f5f5f5;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: #666;
    transition: all 0.2s ease;
}

.dm-card .dm-card-close:hover {
    background: #e0e0e0;
    color: #333;
}

.dm-card .dm-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--dm-text);
    padding-right: 30px;
}

.dm-card .dm-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: #fff;
    width: fit-content;
}

.dm-card .dm-line {
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--dm-text);
}

.dm-card .dm-label {
    min-width: 80px;
    color: var(--dm-text-light);
    font-weight: 500;
}

.dm-card .dm-value {
    flex: 1;
}

.dm-card .dm-value a {
    color: var(--dm-primary);
    text-decoration: none;
}

.dm-card .dm-value a:hover {
    text-decoration: underline;
}

.dm-card .dm-social {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.dm-card .dm-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f5f5f5;
    color: #666;
    transition: all 0.2s ease;
}

.dm-card .dm-social a:hover {
    background: var(--dm-primary);
    color: #fff;
}

.dm-card .dm-social svg {
    width: 18px;
    height: 18px;
}

.dm-card .dm-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.dm-card .dm-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.dm-card .dm-btn-primary {
    background: var(--dm-primary);
    color: #fff;
}

.dm-card .dm-btn-primary:hover {
    background: #007a33;
}

.dm-card .dm-btn-secondary {
    background: #f5f5f5;
    color: var(--dm-text);
}

.dm-card .dm-btn-secondary:hover {
    background: #e0e0e0;
}

/* Mobile Styles */
@media (max-width: 900px) {
    .dm-layout-locator {
        flex-direction: column;
        gap: 16px;
    }
    
    .dm-side {
        order: 1;
        width: 100%;
        min-width: 0;
        background: transparent;
        border-radius: 0;
        padding: 0;
        max-height: none;
    }
    
    .dm-cat-list {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding: 14px;
        overflow-x: auto;
        overflow-y: hidden;
        background: var(--dm-primary);
        border-radius: var(--dm-radius);
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }
    
    .dm-cat-list::-webkit-scrollbar {
        height: 4px;
    }
    
    .dm-cat-list::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.3);
        border-radius: 2px;
    }
    
    .dm-cat-item {
        white-space: nowrap;
        flex: 0 0 auto;
        font-size: 14px;
        padding: 12px 20px;
    }
    
    .dm-dest-list {
        background: var(--dm-primary);
        border-radius: var(--dm-radius);
        margin-top: 8px;
        padding: 14px;
        max-height: 200px;
    }
    
    .dm-copy {
        display: none;
    }
    
    .dm-map-col {
        order: 2;
        display: flex;
        flex-direction: column;
    }
    
    .dm-card {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        margin: 8px 0;
        width: 100%;
        max-width: none;
        min-width: 0;
        padding: 20px;
        order: 2;
    }
    
    .dm-map {
        order: 3;
        height: 450px;
        margin-top: 8px;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .dm-card .dm-title {
        font-size: 18px;
    }
    
    .dm-card .dm-line {
        flex-direction: column;
        gap: 4px;
    }
    
    .dm-card .dm-label {
        min-width: auto;
    }
    
    .dm-map {
        height: 350px;
    }
}

/* Custom scrollbar for sidebar */
.dm-dest-list::-webkit-scrollbar {
    width: 6px;
}

.dm-dest-list::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.dm-dest-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.dm-dest-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}
