/* GTIME PWA Styles */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea, #764ba2);
    --hyperspatial-gradient: linear-gradient(135deg, #f093fb, #f5576c);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --dark-bg: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    overflow: hidden;
    user-select: none;
    position: relative;
    width: 100vw;
    height: 100vh;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-content {
    text-align: center;
}

.logo-animation h1 {
    font-size: 48px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pulse 2s infinite;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin: 20px auto;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: var(--primary-gradient);
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% { width: 0; }
    50% { width: 80%; }
    100% { width: 100%; }
}

/* App Container */
.app-container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* Map Container */
.map-container {
    width: 100%;
    height: 100%;
    position: relative;
}

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

/* Map Mode Toggle */
.map-mode-toggle {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    padding: 5px;
    z-index: 1000;
}

.mode-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.mode-btn.active {
    background: var(--primary-gradient);
    color: white;
}

.mode-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
}

/* Location Controls */
.location-controls {
    position: absolute;
    bottom: 120px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.control-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.15);
}

.control-btn:active {
    transform: scale(0.95);
}

/* Avatar Assistant */
.avatar-assistant {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 100px;
    z-index: 2000;
}

.avatar-model-container {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--primary-gradient);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    position: relative;
}

.avatar-model {
    width: 100%;
    height: 100%;
    --poster-color: transparent;
}

model-viewer::part(default-progress-bar) {
    display: none;
}

/* Speech Interface */
.speech-interface {
    position: absolute;
    bottom: 110px;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.speech-bubble {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 12px 16px;
    max-width: 250px;
    margin-bottom: 10px;
    position: relative;
    animation: fadeInUp 0.3s;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 30px;
    width: 16px;
    height: 16px;
    background: var(--glass-bg);
    border-right: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    transform: rotate(45deg);
}

.speech-bubble p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

.speech-indicator {
    display: inline-flex;
    gap: 3px;
    margin-left: 8px;
}

.speech-indicator span {
    width: 4px;
    height: 4px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: speechDot 1.5s infinite;
}

.speech-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.speech-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes speechDot {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Voice Controls */
.voice-controls {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
}

.voice-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--hyperspatial-gradient);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(240, 147, 251, 0.3);
}

.voice-btn:hover {
    transform: scale(1.1);
}

.voice-btn.listening {
    animation: pulse 1.5s infinite;
    box-shadow: 0 5px 25px rgba(240, 147, 251, 0.6);
}

/* Avatar Selector */
.avatar-selector {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 4px;
}

.avatar-option {
    padding: 4px 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.avatar-option.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Discovery Panel */
.discovery-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 40vh;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s;
    z-index: 1500;
}

.discovery-panel.active {
    transform: translateY(0);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--glass-border);
}

.panel-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.close-panel {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.discovery-list {
    padding: 15px;
    overflow-y: auto;
    max-height: calc(40vh - 60px);
}

.discovery-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.discovery-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

/* Progressive Hooks */
.hook-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    max-width: 320px;
    z-index: 3000;
    animation: fadeInScale 0.5s;
}

.hook-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.hook-text {
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.hook-btn {
    padding: 10px 24px;
    border-radius: 20px;
    border: none;
    background: var(--primary-gradient);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.hook-btn:hover {
    transform: scale(1.05);
}

/* Squad Indicator */
.squad-indicator {
    position: absolute;
    top: 80px;
    left: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 10px 15px;
    z-index: 1000;
}

.squad-members {
    display: flex;
    gap: 5px;
}

.squad-member {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-gradient);
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Onboarding Overlay */
.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.onboarding-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 40px;
    max-width: 400px;
    text-align: center;
}

.onboarding-content h2 {
    font-size: 32px;
    margin-bottom: 15px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.onboarding-steps {
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    transition: all 0.3s;
}

.step-icon {
    font-size: 24px;
}

.start-btn {
    padding: 15px 40px;
    border-radius: 25px;
    border: none;
    background: var(--primary-gradient);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .discovery-panel {
        max-height: 50vh;
    }

    .speech-bubble {
        max-width: 200px;
    }

    .onboarding-content {
        padding: 30px 20px;
        margin: 20px;
    }
}

/* Map Overlays for Hyperspatial Mode */
.hyperspatial-mode {
    filter: hue-rotate(45deg) saturate(1.5) contrast(1.2);
}

.hyperspatial-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: radial-gradient(circle at center, transparent, rgba(240, 147, 251, 0.1));
    mix-blend-mode: overlay;
}

/* ============ DUAL MODE STYLES ============ */

/* App Mode Toggle */
.app-mode-toggle {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding: 5px;
    background: var(--glass-bg);
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.app-mode-btn {
    flex: 1;
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.app-mode-btn.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.app-mode-btn:not(.active):hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Gaming Mode Specific */
[data-app-mode="gaming"] {
    --primary-gradient: linear-gradient(135deg, #f093fb, #f5576c);
}

[data-app-mode="gaming"] .map {
    filter: hue-rotate(30deg) saturate(1.2) contrast(1.1);
}

/* Gaming Controls Panel */
.gaming-controls-panel {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(240, 147, 251, 0.3);
    border-radius: 20px;
    padding: 20px;
    z-index: 1000;
    min-width: 300px;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.gaming-stats {
    margin-bottom: 15px;
}

.stat-item {
    margin-bottom: 12px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 4px;
}

.stat-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 3px;
}

.gaming-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.gaming-btn {
    flex: 1;
    padding: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.gaming-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.5);
}

/* Gaming Mode Map Effects */
.gaming-mode-active {
    position: relative;
    animation: gamingPulse 10s infinite ease-in-out;
}

@keyframes gamingPulse {
    0%, 100% {
        filter: hue-rotate(0deg) saturate(1.2) contrast(1.1);
    }
    50% {
        filter: hue-rotate(30deg) saturate(1.5) contrast(1.2);
    }
}

/* Consciousness View */
.consciousness-view {
    position: relative;
}

.consciousness-view::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(138, 43, 226, 0.2) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(255, 20, 147, 0.2) 0%, transparent 40%);
    pointer-events: none;
    mix-blend-mode: screen;
    animation: consciousnessFlow 15s infinite ease-in-out;
}

@keyframes consciousnessFlow {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

/* Gaming Player Markers */
.gaming-player-marker {
    animation: playerPulse 2s infinite ease-in-out;
}

@keyframes playerPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.gaming-player-icon {
    position: relative;
    animation: iconFloat 3s infinite ease-in-out;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Particle Canvas for Gaming Mode */
#particle-canvas {
    opacity: 0.6;
    mix-blend-mode: screen;
}

/* Player Popup */
.player-popup {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px;
    border-radius: 10px;
    min-width: 150px;
}

.player-popup h4 {
    margin: 0 0 8px 0;
    color: #667eea;
    font-size: 14px;
}

.player-popup p {
    margin: 4px 0;
    font-size: 12px;
    color: var(--text-secondary);
}
}

/* Unified Platform Interface */
.unified-platform-ui {
    position: fixed;
    top: 80px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 2000;
    animation: slideInRight 0.5s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Hunt Controls */
.hunt-controls {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.95), rgba(255, 45, 85, 0.95));
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 10px 40px rgba(255, 45, 85, 0.3);
}

.hunt-btn {
    width: 100%;
    padding: 12px 20px;
    background: white;
    color: #ff2d55;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.hunt-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.3);
}

.hunt-status {
    margin-top: 10px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-size: 12px;
    text-align: center;
    color: white;
    min-height: 24px;
}

/* Social Radar */
.social-radar-container {
    background: linear-gradient(135deg, rgba(0, 30, 60, 0.95), rgba(0, 60, 120, 0.95));
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 10px 40px rgba(0, 60, 120, 0.3);
}

#social-radar {
    width: 100%;
    height: auto;
    border-radius: 50%;
    background: radial-gradient(circle at center,
        rgba(0, 255, 255, 0.1) 0%,
        rgba(0, 100, 200, 0.05) 50%,
        transparent 100%);
    border: 2px solid rgba(0, 255, 255, 0.5);
}

.radar-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 10px;
    color: #00ffff;
    font-size: 12px;
    font-weight: bold;
}

/* Channel Controls */
.channel-controls {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95), rgba(118, 75, 162, 0.95));
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 10px 40px rgba(118, 75, 162, 0.3);
}

.intent-channels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.channel-btn {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.channel-btn.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
    transform: scale(1.05);
}

.channel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.broadcast-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #00ffff, #0080ff);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.broadcast-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 255, 255, 0.5);
}

/* Zone Controls */
.zone-controls {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.95), rgba(255, 152, 0, 0.95));
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 10px 40px rgba(255, 152, 0, 0.3);
    display: flex;
    gap: 10px;
}

.zone-btn {
    flex: 1;
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #ff9800;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.zone-btn:hover {
    background: white;
    transform: scale(1.05);
}

/* Tag Controls */
.tag-controls {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.95), rgba(56, 142, 60, 0.95));
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 10px 40px rgba(76, 175, 80, 0.3);
}

.tag-btn {
    width: 100%;
    padding: 10px;
    background: white;
    color: #4caf50;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.tag-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.3);
}

.tagged-players {
    margin-top: 10px;
    max-height: 100px;
    overflow-y: auto;
}

.tagged-player {
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    margin-top: 5px;
    color: white;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Show unified platform UI only in gaming mode */
body[data-app-mode="practical"] .unified-platform-ui {
    display: none !important;
}

body[data-app-mode="gaming"] .unified-platform-ui {
    display: flex !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .unified-platform-ui {
        top: auto;
        bottom: 100px;
        right: 10px;
        left: 10px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .unified-platform-ui > div {
        flex: 0 0 calc(50% - 7.5px);
    }
}