* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow: hidden;
    background: #2a3f5f;
    width: 100vw;
    height: 100vh;
}

#app {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Search Bar */
.search-container {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 90%;
    max-width: 600px;
    transition: all 0.3s ease;
}

.search-container input {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    border: none;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    outline: none;
    transition: all 0.3s ease;
}

.search-container input:focus {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.3);
}

.search-suggestions {
    display: none;
    background: white;
    border-radius: 10px;
    margin-top: 10px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.search-suggestions.visible {
    display: block;
}

.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.suggestion-item:hover {
    background: #f5f5f5;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Map Container */
.map-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #2a3f5f;
    cursor: grab;
    transition: width 0.3s ease;
}

.map-container.grabbing {
    cursor: grabbing;
}

.map-container.split {
    width: 66.666%;
}

.world-map {
    width: 100%;
    height: 100%;
}

.world-map.animating {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Country Styles */
.country {
    fill: rgba(129, 178, 206, 0.25);
    stroke: #ffffff;
    stroke-width: 0.5;
    stroke-linejoin: round;
    stroke-linecap: round;
    cursor: pointer;
    transition: all 0.3s ease;
    vector-effect: non-scaling-stroke;
}

.country:hover {
    fill: rgba(129, 178, 206, 0.45);
    stroke-width: 0.8;
}

.country.available {
    fill: rgba(129, 178, 206, 0.25);
    stroke: #ffffff;
    stroke-width: 0.5;
}

.country.deactivated {
    fill: rgba(70, 70, 70, 0.6);
    stroke: #888888;
    stroke-width: 0.4;
    cursor: default;
    pointer-events: none;
}

.country.selected {
    fill: rgba(255, 193, 7, 0.5);
    stroke: #ffffff;
    stroke-width: 1.2;
}

/* Country Overlay */
.country-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    cursor: default;
}

.country-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: all;
}

.country-overlay.hidden {
    display: none;
}

.close-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s;
    z-index: 10;
}

.close-overlay:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.overlay-country-name {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 42px;
    font-weight: 300;
    text-align: center;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: fadeInDown 0.5s ease;
    margin: 0;
}

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

.overlay-continent-container {
    width: 98%;
    height: 70%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    margin-top: 35px;
}

.overlay-continent-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 40px rgba(0, 0, 0, 0.5));
    animation: zoomIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.overlay-territories-container {
    width: 98%;
    height: 28%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    pointer-events: auto;
    margin-top: 2px;
}

.overlay-territories-container.hidden {
    display: none;
}

.territories-title {
    color: rgba(255, 255, 255, 0.6);
    font-size: 9px;
    font-weight: 500;
    margin: 0 0 4px 0;
    text-align: center;
    pointer-events: none;
}

.overlay-territories-svg {
    max-width: 100%;
    max-height: 83%;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 15px;
    padding: 5px;
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
    pointer-events: auto;
}

.territory-cell-container {
    position: relative;
    width: 220px;
    height: 170px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.territory-cell-container:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.territory-svg {
    width: 100%;
    height: calc(100% - 26px);
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.territory-path {
    transition: all 0.2s ease;
}

.territory-cell-container:hover .territory-path {
    fill: rgba(129, 178, 206, 0.7);
    stroke-width: 0.8;
}

.territory-label {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.98);
    font-size: 13px;
    font-weight: 600;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
    pointer-events: none;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

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

.overlay-country-svg .country-shape {
    fill: rgba(129, 178, 206, 0.9);
    stroke: #ffffff;
    stroke-width: 0.2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.overlay-country-svg .country-outline {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.overlay-country-svg .country-outline:hover {
    opacity: 0.8;
}

.overlay-country-svg .region-area {
    transition: fill 0.2s ease, stroke-width 0.2s ease;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.overlay-country-svg .region-area:hover {
    fill: rgba(255, 193, 7, 0.4) !important;
    stroke-width: 0.4 !important;
}

.overlay-country-svg .territory-cell {
    transition: fill 0.2s ease, stroke 0.2s ease, stroke-width 0.2s ease;
    rx: 3px;
}

.overlay-country-svg .territory-cell:hover {
    fill: rgba(255, 193, 7, 0.2) !important;
    stroke: #FFC107 !important;
    stroke-width: 1 !important;
}

/* Hover Tooltip */
.hover-tooltip {
    position: fixed;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    padding: 15px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 3000;
    transition: opacity 0.2s ease;
}

.hover-tooltip.hidden {
    opacity: 0;
    display: none;
}

.tooltip-header {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
    border-bottom: 2px solid #2a3f5f;
    padding-bottom: 8px;
}

.tooltip-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tooltip-featured {
    width: 100%;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
    position: relative;
}

.tooltip-featured img,
.tooltip-featured video,
.tooltip-featured iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
}

.tooltip-featured-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    color: white;
    padding: 20px 10px 10px 10px;
    font-size: 13px;
    font-weight: 600;
    z-index: 1;
    pointer-events: none;
}

.tooltip-others {
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.tooltip-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    font-size: 11px;
    color: #555;
}

.tooltip-item img,
.tooltip-item video {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.tooltip-item-text {
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 10px;
    line-height: 1.2;
}

/* Content Drawer */
.content-drawer {
    position: fixed;
    right: 0;
    top: 0;
    width: 33.333%;
    height: 100vh;
    background: #ffffff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-drawer.visible {
    transform: translateX(0);
}

.close-drawer {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: all 0.2s;
    z-index: 10;
}

.close-drawer:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

.drawer-search-container {
    padding: 20px;
    padding-top: 70px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.drawer-search-container input {
    width: 100%;
    padding: 12px 15px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    transition: all 0.2s;
}

.drawer-search-container input:focus {
    border-color: #2a3f5f;
    box-shadow: 0 2px 8px rgba(42, 63, 95, 0.1);
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.loader {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.media-item {
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.media-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.media-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.media-info {
    padding: 12px;
}

.media-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.media-source {
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
}

.media-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-youtube {
    background: #ff0000;
    color: white;
}

.badge-photo {
    background: #00d4ff;
    color: white;
}

.badge-vimeo {
    background: #1ab7ea;
    color: white;
}

/* Mobile Handle */
.mobile-handle {
    display: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .search-container {
        top: 10px;
        width: 95%;
        max-width: none;
    }

    .search-container input {
        padding: 12px 15px;
        font-size: 14px;
    }

    .map-container.split {
        width: 100%;
    }

    .content-drawer {
        width: 100%;
        top: auto;
        bottom: 0;
        height: 50%;
        transform: translateY(100%);
        border-radius: 20px 20px 0 0;
        z-index: 2500 !important;
    }
    
    .content-drawer.visible {
        transform: translateY(0);
    }
    
    .content-drawer.full-height {
        height: 90%;
    }

    .mobile-handle {
        display: block;
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 100%;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: grab;
        touch-action: none;
    }

    .mobile-handle.grabbing {
        cursor: grabbing;
    }

    .handle-bar {
        width: 40px;
        height: 4px;
        background: #ccc;
        border-radius: 2px;
    }

    .drawer-search-container {
        padding-top: 60px;
    }

    .media-grid {
        grid-template-columns: 1fr;
    }

    .media-thumbnail {
        height: 200px;
    }
    
    .hover-tooltip {
        width: 320px;
    }
    
    .tooltip-featured {
        height: 120px;
    }
    
    .tooltip-item img,
    .tooltip-item video {
        height: 50px;
    }
    
    .tooltip-item-text {
        font-size: 9px;
    }
    
    .overlay-country-name {
        font-size: 28px;
        top: 60px;
    }
    
    .close-overlay {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 30px;
        background: rgba(255, 255, 255, 0.15);
        border-color: rgba(255, 255, 255, 0.4);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    /* Add hint text on mobile */
    .country-overlay::before {
        content: 'Tap X or wait to see content';
        position: absolute;
        bottom: 30px;
        left: 50%;
        transform: translateX(-50%);
        color: rgba(255, 255, 255, 0.5);
        font-size: 13px;
        background: rgba(0, 0, 0, 0.3);
        padding: 8px 16px;
        border-radius: 20px;
        animation: fadeInOut 3s infinite;
    }
    
    @keyframes fadeInOut {
        0%, 100% {
            opacity: 0.5;
        }
        50% {
            opacity: 1;
        }
    }
    
    .country-overlay {
        position: fixed !important;
        width: 100vw !important;
        height: 100vh !important;
        z-index: 3000 !important;
    }
    
    .overlay-country-container {
        width: 95%;
        height: 65%;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Territory Pagination Controls */
.territory-pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    margin-top: 8px;
    z-index: 4000;
}

.territory-page-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
}

.territory-page-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.territory-page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.territory-page-info {
    color: white;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.territory-total {
    font-size: 10px;
    opacity: 0.7;
}

