/* ════════════════════════════════════════════════════════════════════════════
   TeamSpeak 3D Globe - Styles
   MIT SCREENSHOT RESULT BOX
   + Tag/Nacht Toggle
   + UserList Dropdown
   + Sound Toggle
   + Erweiterte Uhrzeiten (12 Länder)
   + Kilometer-Anzeige
   + Aktualisieren Button
   ════════════════════════════════════════════════════════════════════════════ */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000;
    color: #e6edf3;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* ════════════════════════════════════════════════════════════════════════════
   GLOBE CONTAINER
   ════════════════════════════════════════════════════════════════════════════ */

#globe-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#globe-container canvas {
    display: block;
}

/* ════════════════════════════════════════════════════════════════════════════
   HEADER
   ════════════════════════════════════════════════════════════════════════════ */

#globe-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none;
}

#globe-header > * {
    pointer-events: auto;
}

.header-left {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.header-left h1 {
    font-size: 22px;
    color: #00ff99;
    text-shadow: 0 0 20px rgba(0, 255, 153, 0.5);
    margin: 0;
}

.header-subtitle {
    font-size: 12px;
    color: #8b949e;
}

.header-center {
    display: flex;
    justify-content: center;
}

.header-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ════════════════════════════════════════════════════════════════════════════
   HEADER BUTTONS
   ════════════════════════════════════════════════════════════════════════════ */

.header-btn {
    background: rgba(88, 166, 255, 0.15);
    border: 1px solid rgba(88, 166, 255, 0.4);
    color: #58a6ff;
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.header-btn:hover {
    background: rgba(88, 166, 255, 0.3);
    transform: scale(1.05);
}

/* YouTube Button */
.header-center .header-btn {
    background: rgba(255, 0, 0, 0.15);
    border-color: rgba(255, 0, 0, 0.4);
    color: #ff5a5a;
}

.header-center .header-btn:hover {
    background: rgba(255, 0, 0, 0.3);
}

/* TeamSpeak Join Button (NEU) */
.ts-join-btn {
    background: rgba(0, 255, 153, 0.15) !important;
    border-color: rgba(0, 255, 153, 0.5) !important;
    color: #00ff99 !important;
}

.ts-join-btn:hover {
    background: rgba(0, 255, 153, 0.3) !important;
    box-shadow: 0 0 15px rgba(0, 255, 153, 0.4);
}

/* ════════════════════════════════════════════════════════════════════════════
   USERLIST DROPDOWN (NEU)
   ════════════════════════════════════════════════════════════════════════════ */

.userlist-dropdown {
    position: relative;
    display: inline-block;
}

.userlist-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 280px;
    max-width: 350px;
    max-height: 400px;
    background: rgba(13, 17, 23, 0.98);
    border: 1px solid rgba(88, 166, 255, 0.4);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    z-index: 200;
    overflow: hidden;
    margin-top: 8px;
}

/* Hover zeigt Dropdown */
.userlist-dropdown:hover .userlist-dropdown-content {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.userlist-header {
    padding: 12px 16px;
    font-weight: 700;
    color: #58a6ff;
    border-bottom: 1px solid rgba(48, 54, 61, 0.6);
    background: rgba(88, 166, 255, 0.1);
}

.userlist-items {
    max-height: 340px;
    overflow-y: auto;
    padding: 8px 0;
}

.userlist-items::-webkit-scrollbar {
    width: 8px;
}

.userlist-items::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.userlist-items::-webkit-scrollbar-thumb {
    background: rgba(88, 166, 255, 0.4);
    border-radius: 4px;
}

.userlist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(48, 54, 61, 0.3);
}

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

.userlist-item:hover {
    background: rgba(88, 166, 255, 0.15);
}

.userlist-item-flag {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.userlist-item-info {
    flex: 1;
    min-width: 0;
}

.userlist-item-name {
    font-weight: 600;
    color: #e6edf3;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.userlist-item-location {
    font-size: 11px;
    color: #8b949e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.userlist-item-threat {
    font-size: 14px;
}

.userlist-empty {
    padding: 20px 16px;
    text-align: center;
    color: #8b949e;
    font-size: 13px;
}

#userlist-count {
    font-size: 11px;
    opacity: 0.8;
}

/* ════════════════════════════════════════════════════════════════════════════
   SCREENSHOT RESULT BOX
   ════════════════════════════════════════════════════════════════════════════ */

.screenshot-result {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 150;

    background: rgba(13, 17, 23, 0.95);
    border: 1px solid rgba(0, 255, 153, 0.4);
    border-radius: 12px;
    padding: 16px 20px;
    min-width: 400px;
    max-width: 600px;

    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.screenshot-result-title {
    font-weight: 800;
    color: #00ff99;
    margin-bottom: 10px;
    font-size: 14px;
}

.screenshot-result-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

#screenshot-url {
    flex: 1;
    min-width: 250px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(88, 166, 255, 0.4);
    background: rgba(0, 0, 0, 0.5);
    color: #e6edf3;
    font-size: 12px;
    font-family: 'Consolas', monospace;
}

.screenshot-msg {
    margin-top: 10px;
    font-size: 12px;
    color: #8b949e;
}

.screenshot-msg.success {
    color: #00ff99;
}

.screenshot-msg.error {
    color: #ff4757;
}

/* ════════════════════════════════════════════════════════════════════════════
   CONTROLS (links)
   ════════════════════════════════════════════════════════════════════════════ */

#globe-controls {
    position: fixed;
    top: 70px;
    left: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(13, 17, 23, 0.85);
    border: 1px solid rgba(48, 54, 61, 0.6);
    border-radius: 10px;
    padding: 8px 12px;
    backdrop-filter: blur(10px);
    flex-wrap: wrap;
}

.control-label {
    font-size: 12px;
    color: #8b949e;
    min-width: 70px;
}

.control-btn {
    background: rgba(88, 166, 255, 0.15);
    border: 1px solid rgba(88, 166, 255, 0.4);
    color: #58a6ff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.control-btn:hover {
    background: rgba(88, 166, 255, 0.3);
}

.control-btn.active {
    background: rgba(0, 255, 153, 0.2);
    border-color: rgba(0, 255, 153, 0.5);
    color: #00ff99;
}

/* ════════════════════════════════════════════════════════════════════════════
   STATUS BAR (unten)
   ════════════════════════════════════════════════════════════════════════════ */

#globe-status {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
    font-size: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.status-left, .status-center, .status-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #00ff99;
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px rgba(0, 255, 153, 0.6);
}

.status-dot.offline {
    background: #ff4757;
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

.status-divider {
    color: #30363d;
}

/* ════════════════════════════════════════════════════════════════════════════
   WORLD CLOCKS (erweitert auf 12 Länder)
   ════════════════════════════════════════════════════════════════════════════ */

#world-clocks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.clock {
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.3);
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'Consolas', monospace;
    font-size: 11px;
    white-space: nowrap;
}

/* Legend */
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #8b949e;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.5);
}

.legend-dot.normal { background: #58a6ff; }
.legend-dot.suspicious { background: #f0883e; }
.legend-dot.bot { background: #a855f7; }
.legend-dot.danger { background: #ff4757; }
.legend-dot.fixed { background: #ff4757; box-shadow: 0 0 8px #ff4757; }

/* ════════════════════════════════════════════════════════════════════════════
   TOOLTIP (Hover)
   ════════════════════════════════════════════════════════════════════════════ */

#globe-tooltip {
    position: fixed;
    z-index: 200;
    background: rgba(13, 17, 23, 0.95);
    border: 1px solid rgba(88, 166, 255, 0.4);
    border-radius: 10px;
    padding: 12px 16px;
    min-width: 200px;
    max-width: 320px;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

#globe-tooltip.tooltip-hidden {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

#globe-tooltip.tooltip-visible {
    opacity: 1;
    transform: translateY(0);
}

.tooltip-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(48, 54, 61, 0.6);
}

#tooltip-flag {
    font-size: 24px;
}

#tooltip-name {
    font-weight: 700;
    font-size: 14px;
    color: #e6edf3;
}

.tooltip-body {
    font-size: 12px;
    color: #8b949e;
    line-height: 1.4;
}

#tooltip-location {
    margin-bottom: 4px;
}

#tooltip-distance {
    margin-top: 6px;
    color: #00ff99;
    font-weight: 600;
}

/* ════════════════════════════════════════════════════════════════════════════
   INFO PANEL (rechts) - User Details
   ════════════════════════════════════════════════════════════════════════════ */

#globe-info-panel {
    position: fixed;
    top: 70px;
    right: 0;
    bottom: 60px;
    width: 340px;
    z-index: 100;
    background: rgba(13, 17, 23, 0.92);
    border-left: 1px solid rgba(48, 54, 61, 0.6);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

#globe-info-panel.panel-collapsed {
    transform: translateX(300px);
}

.panel-toggle {
    position: absolute;
    left: -36px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 60px;
    background: rgba(13, 17, 23, 0.92);
    border: 1px solid rgba(48, 54, 61, 0.6);
    border-right: none;
    border-radius: 10px 0 0 10px;
    color: #58a6ff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-toggle:hover {
    background: rgba(88, 166, 255, 0.2);
}

#globe-info-panel.panel-collapsed .panel-toggle {
    transform: translateY(-50%) rotate(180deg);
}

.panel-content {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.panel-title {
    font-size: 16px;
    font-weight: 700;
    color: #58a6ff;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(48, 54, 61, 0.6);
}

.panel-empty {
    color: #8b949e;
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

.panel-user-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.panel-flag {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
}

.panel-name {
    font-size: 16px;
    font-weight: 700;
    color: #e6edf3;
}

.panel-sub {
    font-size: 12px;
    color: #8b949e;
    margin-top: 2px;
}

.panel-section {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(48, 54, 61, 0.4);
}

.panel-section-title {
    font-size: 11px;
    color: #58a6ff;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 6px;
}

.panel-text {
    font-size: 13px;
    color: #e6edf3;
    line-height: 1.4;
}

/* Kilometer-Anzeige (NEU) */
.panel-distance {
    color: #00ff99 !important;
    font-weight: 700;
    font-size: 15px !important;
}

.panel-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.panel-actions .control-btn {
    flex: 1;
    text-align: center;
    min-width: 100px;
}

/* ════════════════════════════════════════════════════════════════════════════
   LOADING OVERLAY
   ════════════════════════════════════════════════════════════════════════════ */

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background: radial-gradient(ellipse at center, #0d1117 0%, #000 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transition: opacity 0.5s;
}

#loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 255, 153, 0.2);
    border-top-color: #00ff99;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 20px;
    color: #00ff99;
    text-shadow: 0 0 20px rgba(0, 255, 153, 0.5);
}

.loading-progress {
    font-size: 12px;
    color: #8b949e;
}

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
    #world-clocks {
        max-width: 400px;
    }

    .clock {
        font-size: 10px;
        padding: 3px 6px;
    }
}

@media (max-width: 900px) {
    #globe-controls {
        top: auto;
        bottom: 70px;
        left: 10px;
        right: 10px;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .control-group {
        flex: 1;
        min-width: 150px;
    }

    #globe-info-panel {
        width: 100%;
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        height: 300px;
        border-left: none;
        border-top: 1px solid rgba(48, 54, 61, 0.6);
    }

    #globe-info-panel.panel-collapsed {
        transform: translateY(260px);
    }

    .panel-toggle {
        left: 50%;
        top: -36px;
        transform: translateX(-50%) rotate(90deg);
        width: 60px;
        height: 36px;
        border-radius: 10px 10px 0 0;
        border: 1px solid rgba(48, 54, 61, 0.6);
        border-bottom: none;
    }

    #globe-info-panel.panel-collapsed .panel-toggle {
        transform: translateX(-50%) rotate(-90deg);
    }

    #world-clocks {
        display: none;
    }

    .screenshot-result {
        min-width: 300px;
        left: 10px;
        right: 10px;
        transform: none;
    }

    .header-right {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .userlist-dropdown-content {
        right: -50px;
    }
}

@media (max-width: 600px) {
    .header-left h1 {
        font-size: 16px;
    }

    .header-subtitle {
        display: none;
    }

    .header-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    .header-center {
        display: none;
    }
}
