/**
 * LetzPrint Treasure Hunt Map — Styles
 * Mobile-first, responsive design
 */

/* ============================================
   RESET & CONTAINER
   ============================================ */

#lpth-treasure-hunt-app {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    position: relative;
    background: #0d1117;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

#lpth-treasure-hunt-app * {
    box-sizing: border-box;
}

/* ============================================
   MAP
   ============================================ */

#lpth-map-container {
    width: 100%;
    height: 400px;
    z-index: 1;
}

#lpth-map-container .leaflet-container {
    background: #0d1117;
}

/* ============================================
   SIDEBAR
   ============================================ */

#lpth-sidebar {
    background: #161b22;
    color: #e6edf3;
    padding: 16px;
    overflow-y: auto;
    max-height: 50vh;
}

/* Progress Bar */
.lpth-progress {
    margin-bottom: 16px;
}

.lpth-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 6px;
    color: #8b949e;
}

.lpth-progress-label strong {
    color: #58a6ff;
}

.lpth-progress-bar-outer {
    background: #21262d;
    border-radius: 8px;
    height: 10px;
    overflow: hidden;
}

.lpth-progress-bar-inner {
    background: linear-gradient(90deg, #238636, #3fb950);
    height: 100%;
    border-radius: 8px;
    transition: width 0.6s ease;
}

/* Search */
.lpth-search {
    position: relative;
    margin-bottom: 16px;
}

.lpth-search input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 8px;
    color: #e6edf3;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.lpth-search input:focus {
    border-color: #58a6ff;
}

.lpth-search input::placeholder {
    color: #484f58;
}

.lpth-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #484f58;
    font-size: 14px;
    pointer-events: none;
}

/* Status Filter Tabs */
.lpth-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.lpth-tab {
    padding: 6px 12px;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 20px;
    color: #8b949e;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.lpth-tab:hover {
    border-color: #58a6ff;
    color: #58a6ff;
}

.lpth-tab.active {
    background: #1f6feb;
    border-color: #1f6feb;
    color: white;
}

.lpth-tab .count {
    display: inline-block;
    min-width: 18px;
    text-align: center;
    padding: 1px 5px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    font-size: 11px;
    margin-left: 4px;
}

/* Commune List */
.lpth-commune-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lpth-commune-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 2px;
}

.lpth-commune-item:hover {
    background: #21262d;
}

.lpth-commune-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.lpth-commune-dot.pending { background: #484f58; }
.lpth-commune-dot.active { background: #f85149; animation: lpth-pulse 2s infinite; }
.lpth-commune-dot.completed { background: #3fb950; }

.lpth-commune-name {
    flex: 1;
    font-size: 14px;
    color: #e6edf3;
}

.lpth-commune-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

.lpth-commune-badge.pending { background: #21262d; color: #484f58; }
.lpth-commune-badge.active { background: rgba(248,81,73,0.15); color: #f85149; }
.lpth-commune-badge.completed { background: rgba(63,185,80,0.15); color: #3fb950; }

/* ============================================
   POPUP / LIGHTBOX
   ============================================ */

.lpth-popup {
    min-width: 200px;
    max-width: 280px;
}

.lpth-popup h3 {
    margin: 0 0 8px;
    font-size: 16px;
    color: #1A73B5;
}

.lpth-popup .status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}

.lpth-popup .status-badge.active {
    background: #fde2e2;
    color: #e74c3c;
}

.lpth-popup .status-badge.completed {
    background: #d4edda;
    color: #27ae60;
}

.lpth-popup .status-badge.pending {
    background: #f0f0f0;
    color: #999;
}

.lpth-popup .hint-text {
    font-style: italic;
    color: #555;
    margin: 8px 0;
    font-size: 13px;
    line-height: 1.5;
}

.lpth-popup .video-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e74c3c;
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    margin-top: 6px;
    transition: background 0.2s;
}

.lpth-popup .video-link:hover {
    background: #c0392b;
}

.lpth-popup .winner-info {
    margin-top: 8px;
}

.lpth-popup .winner-selfie {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin: 8px 0;
    cursor: pointer;
}

.lpth-popup .winner-name {
    font-weight: bold;
    font-size: 14px;
}

.lpth-popup .insta-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    margin-top: 6px;
    transition: opacity 0.2s;
}

.lpth-popup .insta-link:hover {
    opacity: 0.85;
}

/* ============================================
   LIGHTBOX (Full-screen image viewer)
   ============================================ */

.lpth-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: pointer;
    padding: 20px;
}

.lpth-lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
}

.lpth-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    border: none;
    transition: background 0.2s;
}

.lpth-lightbox-close:hover {
    background: rgba(255,255,255,0.25);
}

.lpth-lightbox-info {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    font-size: 16px;
}

.lpth-lightbox-info h3 {
    margin: 0 0 4px;
    font-size: 20px;
}

.lpth-lightbox-info small {
    color: rgba(255,255,255,0.6);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.lpth-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #238636;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10001;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: lpth-fadeInUp 0.3s ease, lpth-fadeOut 0.3s ease 2.7s;
    pointer-events: none;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes lpth-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

@keyframes lpth-fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ============================================
   TABLET (768px+)
   ============================================ */

@media (min-width: 768px) {
    #lpth-treasure-hunt-app {
        flex-direction: row;
        height: 650px;
    }

    #lpth-map-container {
        flex: 1;
        height: 100%;
    }

    #lpth-sidebar {
        width: 320px;
        max-height: none;
        height: 100%;
        border-left: 1px solid #21262d;
    }
}

/* ============================================
   DESKTOP (1024px+)
   ============================================ */

@media (min-width: 1024px) {
    #lpth-sidebar {
        width: 360px;
    }

    #lpth-treasure-hunt-app {
        height: 700px;
    }
}

/* ============================================
   SMALL MOBILE (<400px)
   ============================================ */

@media (max-width: 400px) {
    #lpth-map-container {
        height: 300px;
    }

    .lpth-tabs {
        gap: 4px;
    }

    .lpth-tab {
        padding: 5px 8px;
        font-size: 11px;
    }

    .lpth-commune-item {
        padding: 8px 10px;
    }

    .lpth-popup {
        min-width: 180px;
        max-width: 240px;
    }
}
