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

:root {
    --primary-purple: #a855f7;
    --primary-blue: #3b82f6;
    --dark-bg: #0f0f1e;
    --dark-card: #1a1a2e;
    --text-primary: #ffffff;
    --text-secondary: #b4b4d1;
    --accent-pink: #ec4899;
    --accent-cyan: #06b6d4;
}

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 50%, #0f0f1e 100%);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
}

/* Animated Background Shapes */
.bg-gradient-left {
    position: fixed;
    top: -10%;
    left: -5%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
    z-index: -1;
    animation: float 20s ease-in-out infinite;
}

.bg-gradient-right {
    position: fixed;
    bottom: -10%;
    right: -5%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
    z-index: -1;
    animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 30px); }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Navigation Bar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(26, 26, 46, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    margin: 0 -20px 40px -20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: bold;
}

.brand-icon {
    font-size: 2rem;
}

.navbar-brand h1 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--primary-purple);
}

.nav-button {
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-blue) 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.nav-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(168, 85, 247, 0.3);
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    margin-bottom: 80px;
    position: relative;
    min-height: 400px;
}

.hero-content h2 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: 3px;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 30px;
    max-width: 500px;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-top: 40px;
}

.btn-learn-more {
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-blue) 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-learn-more:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(168, 85, 247, 0.4);
}

.connection-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 25px;
    font-size: 0.95rem;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-cyan);
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px var(--accent-cyan);
}

.status-indicator.connected {
    background: var(--accent-cyan);
    animation: none;
    box-shadow: 0 0 10px var(--accent-cyan);
}

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

.hero-decoration {
    position: relative;
    height: 300px;
}

.gradient-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    animation: drift 20s ease-in-out infinite;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.4), transparent);
    top: 0;
    right: 0;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.4), transparent);
    bottom: 0;
    right: 100px;
    animation: drift 15s ease-in-out infinite reverse;
}

@keyframes drift {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(20px, -20px); }
    50% { transform: translate(0, 20px); }
    75% { transform: translate(-20px, 0); }
}

/* Domain Section */
.domain-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    text-align: center;
    margin-bottom: 50px;
}

.domain-filter {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    background: rgba(26, 26, 46, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 10px;
}

.domain-filter label {
    font-weight: 600;
    font-size: 0.95rem;
}

.domain-filter select {
    background: rgba(15, 15, 30, 0.8);
    color: var(--text-primary);
    border: 1px solid rgba(168, 85, 247, 0.2);
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    min-width: 200px;
    transition: all 0.3s;
}

.domain-filter select:hover {
    border-color: var(--primary-purple);
}

.domain-filter select:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

/* Time Filter */
.time-filter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.time-filter label {
    font-weight: 600;
    font-size: 0.95rem;
}

.time-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.time-btn {
    padding: 8px 16px;
    background: rgba(26, 26, 46, 0.6);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.time-btn:hover {
    border-color: rgba(168, 85, 247, 0.5);
    color: rgba(255, 255, 255, 0.9);
}

.time-btn.active {
    background: rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.8);
    color: #667eea;
    font-weight: 600;
}

/* Metric Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 60px;
}

.metric-card {
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(168, 85, 247, 0.2);
    padding: 30px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(59, 130, 246, 0.1));
    transition: left 0.5s ease;
    z-index: 0;
}

.metric-card:hover::before {
    left: 100%;
}

.metric-card:hover {
    border-color: rgba(168, 85, 247, 0.5);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(168, 85, 247, 0.2);
}

.metric-icon {
    font-size: 3rem;
    z-index: 1;
}

.metric-content {
    position: relative;
    z-index: 1;
}

.metric-content h3 {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.metric-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Section Cards */
.section-card {
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 40px;
    transition: all 0.3s;
}

.section-card:hover {
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 20px 40px rgba(168, 85, 247, 0.1);
}

.section-header {
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Map Container */
.map-container {
    width: 100%;
    height: 500px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(15, 15, 30, 0.8);
    border: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: inset 0 0 20px rgba(102, 126, 234, 0.05);
    display: block;
    position: relative;
}

#map {
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(135deg, rgba(20, 20, 40, 0.9) 0%, rgba(30, 30, 50, 0.9) 100%);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.chart-wrapper {
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s;
}

.chart-wrapper:hover {
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 20px 40px rgba(168, 85, 247, 0.1);
}

.chart-header {
    margin-bottom: 20px;
}

.chart-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

canvas {
    max-height: 300px;
}

/* Activity Feed */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(15, 15, 30, 0.5);
    border-left: 3px solid var(--primary-purple);
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.activity-item:hover {
    background: rgba(168, 85, 247, 0.1);
    border-left-color: var(--primary-blue);
}

.activity-time {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.no-data {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
    font-style: italic;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    border-top: 1px solid rgba(168, 85, 247, 0.2);
    margin-top: 60px;
}

.footer a {
    color: var(--primary-purple);
    text-decoration: none;
    transition: color 0.3s;
}

.footer a:hover {
    color: var(--primary-blue);
}

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

::-webkit-scrollbar-track {
    background: rgba(26, 26, 46, 0.5);
}

::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.8);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        margin-bottom: 40px;
    }

    .hero-decoration {
        display: none;
    }

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

    .hero-content h2 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 20px;
        padding: 15px 20px;
    }

    .navbar-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

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

    .hero-content h2 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section-card {
        padding: 20px;
    }

    .chart-wrapper {
        padding: 15px;
    }

    .map-container {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .navbar {
        margin: 0 -10px 20px -10px;
    }

    .hero-content h2 {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .metric-card {
        flex-direction: column;
        text-align: center;
    }

    .domain-filter {
        flex-direction: column;
        gap: 10px;
    }

    .domain-filter select {
        min-width: 100%;
    }
}

/* Leaflet Map Overrides */
.leaflet-container {
    background: #0f0f1e;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
}

.leaflet-control-attribution {
    background: rgba(26, 26, 46, 0.8) !important;
    color: rgba(255, 255, 255, 0.7) !important;
    border-radius: 4px !important;
}

.leaflet-control-attribution a {
    color: #667eea !important;
    text-decoration: none;
}

.leaflet-control-zoom {
    border-radius: 6px !important;
    overflow: hidden;
}

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
    background-color: rgba(26, 26, 46, 0.9) !important;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2) !important;
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: bold;
}

.leaflet-control-zoom-in:hover,
.leaflet-control-zoom-out:hover {
    background-color: rgba(102, 126, 234, 0.3) !important;
}
