/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3a86ff;
    --secondary-color: #8338ec;
    --accent-color: #ff006e;
    --dark-bg: #0a0a0f;
    --darker-bg: #050507;
    --light-text: #ffffff;
    --gray-text: #b0b0b0;
    --card-bg: #14141f;
    --card-border: #2a2a3a;
    --gradient-1: linear-gradient(135deg, #3a86ff 0%, #8338ec 100%);
    --gradient-2: linear-gradient(135deg, #ff006e 0%, #fb5607 100%);
    --success-color: #06d6a0;
    --warning-color: #ffbe0b;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--dark-bg);
    color: var(--light-text);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 30%, rgba(58, 134, 255, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(131, 56, 236, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Language Selector */
.language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(20, 20, 31, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 50px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-selector:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(58, 134, 255, 0.2);
}

.language-selector i {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.language-selector span {
    font-size: 0.9rem;
    font-weight: 500;
}

.language-dropdown {
    position: fixed;
    top: 80px;
    right: 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 8px;
    width: 220px;
    display: none;
    z-index: 999;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-height: 400px;
    overflow-y: auto;
}

.language-dropdown.active {
    display: block;
}

.language-option {
    padding: 10px 16px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.language-option:hover {
    background: rgba(58, 134, 255, 0.1);
    color: var(--primary-color);
}

.language-option.active {
    background: var(--gradient-1);
    color: white;
}

.language-option .flag {
    font-size: 1.2rem;
}

/* Node Network Animation */
.node-network {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

.node {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--primary-color);
    animation: pulse 3s infinite;
}

.connection {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    transform-origin: 0 0;
    opacity: 0.2;
}

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

/* Main Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    position: relative;
    z-index: 10;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 100px 0;
}

.hero-badge {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(58, 134, 255, 0.1);
    border: 1px solid rgba(58, 134, 255, 0.3);
    border-radius: 50px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 30px;
    backdrop-filter: blur(5px);
    width: fit-content;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff 0%, #b0b0b0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    max-width: 900px;
}

.hero-title span {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    color: var(--gray-text);
    max-width: 700px;
    margin-bottom: 40px;
}

.hero-stats {
    display: flex;
    gap: 50px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray-text);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 16px 32px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 10px 30px rgba(58, 134, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(58, 134, 255, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--card-border);
    color: var(--light-text);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    background: rgba(58, 134, 255, 0.1);
}

/* Section Styles */
.section {
    padding: 100px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff 0%, #b0b0b0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--gray-text);
    max-width: 700px;
    margin-bottom: 50px;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 50px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 30px;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.card-text {
    color: var(--gray-text);
    font-size: 0.95rem;
}

.security-card {
    padding: 50px;
}

.security-text {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Features List */
.features-list {
    list-style: none;
    margin-top: 20px;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--gray-text);
}

.features-list li::before {
    content: '✓';
    color: var(--success-color);
    font-weight: bold;
    margin-left: 10px;
}

[dir="ltr"] .features-list li::before {
    margin-left: 0;
    margin-right: 10px;
}

.benefits-container {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.benefits-list {
    display: inline-block;
    text-align: right;
    background: rgba(58, 134, 255, 0.05);
    padding: 30px 50px;
    border-radius: 20px;
    border: 1px solid var(--card-border);
}

[dir="ltr"] .benefits-list {
    text-align: left;
}

/* Token Section */
.token-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 50px;
}

.token-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.token-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.token-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-1);
}

.token-card.featured::before {
    background: var(--gradient-2);
}

.token-amount {
    font-size: 3rem;
    font-weight: 700;
    margin: 20px 0;
    color: var(--primary-color);
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, rgba(58, 134, 255, 0.1) 0%, rgba(131, 56, 236, 0.1) 100%);
    border-radius: 50px;
    padding: 80px;
    text-align: center;
    border: 1px solid var(--card-border);
    margin: 50px 0;
}

.cta-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.cta-grid {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.cta-item {
    text-align: center;
}

.cta-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Footer */
.footer {
    padding: 50px 0;
    border-top: 1px solid var(--card-border);
    margin-top: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--gray-text);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* RTL/LTR Support */
[dir="ltr"] .language-selector {
    right: auto;
    left: 20px;
}

[dir="ltr"] .language-dropdown {
    right: auto;
    left: 20px;
}

[dir="ltr"] .hero-badge,
[dir="ltr"] .section-title,
[dir="ltr"] .section-subtitle {
    text-align: left;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .token-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cta-section {
        padding: 60px 30px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
    
    .grid-2,
    .grid-4,
    .token-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-stats {
        gap: 30px;
    }
    
    .cta-section {
        padding: 40px 20px;
    }
    
    .cta-title {
        font-size: 2rem;
    }
    
    .cta-grid {
        gap: 30px;
    }
    
    .footer {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    .benefits-list {
        padding: 20px 30px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .token-card {
        padding: 30px 20px;
    }
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.float {
    animation: float 6s ease-in-out infinite;
}

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

.hero,
.section {
    animation: fadeIn 1s ease-out;
}

/* Loading State */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--card-border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

::-webkit-scrollbar-track {
    background: var(--darker-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}


/* Map Container */
.map-section {
    padding: 50px 0 100px;
    position: relative;
    background: var(--dark-bg);
}

.map-container {
    position: relative;
    width: 100%;
    height: 700px;
    background: var(--darker-bg);
    border-radius: 30px;
    border: 1px solid var(--card-border);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.map-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: radial-gradient(circle at 30% 30%, rgba(58, 134, 255, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 70% 70%, rgba(58, 134, 255, 0.05) 0%, transparent 50%);
}

#worldMap {
    width: 100%;
    height: 100%;
    display: block;
}

/* Continent Shapes */
.continent {
    fill: rgba(58, 134, 255, 0.02);
    stroke: rgba(58, 134, 255, 0.15);
    stroke-width: 1;
    transition: all 0.3s ease;
}

.continent:hover {
    fill: rgba(58, 134, 255, 0.05);
    stroke: rgba(58, 134, 255, 0.3);
}

/* Node Dots */
.node-dot {
    cursor: pointer;
    transition: all 0.2s ease;
}

.node-dot.active circle {
    fill: #3a86ff;
    filter: url(#glow);
    animation: nodePulse 3s infinite;
}

.node-dot.inactive circle {
    fill: #4a4a5a;
    opacity: 0.3;
}

.node-dot circle {
    transition: r 0.2s ease, fill 0.2s ease;
}

.node-dot:hover circle {
    r: 8;
}

/* Node Pulse Animation */
@keyframes nodePulse {
    0% {
        r: 4;
        opacity: 1;
    }
    50% {
        r: 6;
        opacity: 0.8;
    }
    100% {
        r: 4;
        opacity: 1;
    }
}

/* Map Overlay */
.map-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    background: rgba(20, 20, 31, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 20px;
    min-width: 250px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.map-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.map-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
}

.map-stat-label {
    color: var(--gray-text);
    font-weight: 400;
}

.map-stat-value {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.2rem;
}

.map-stat-value.active-nodes {
    color: var(--primary-color);
    text-shadow: 0 0 20px rgba(58, 134, 255, 0.5);
    animation: countPulse 2s infinite;
}

@keyframes countPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.map-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--card-border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.active-light {
    background: #3a86ff;
    box-shadow: 0 0 15px #3a86ff;
    animation: legendPulse 2s infinite;
}

.legend-dot.active-dark {
    background: #1a4a8b;
}

.legend-dot.inactive {
    background: #4a4a5a;
}

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

/* Map Controls */
.map-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.map-control-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(20, 20, 31, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    color: var(--light-text);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-control-btn:hover {
    border-color: var(--primary-color);
    background: rgba(58, 134, 255, 0.2);
    transform: scale(1.1);
}

.map-control-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Node Tooltip */
.node-tooltip {
    position: fixed;
    background: rgba(20, 20, 31, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--primary-color);
    border-radius: 16px;
    padding: 20px;
    min-width: 280px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    pointer-events: none;
    transition: opacity 0.2s ease;
    border-left: 4px solid var(--primary-color);
}

.tooltip-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--light-text);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--card-border);
}

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

.tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.tooltip-label {
    color: var(--gray-text);
    display: flex;
    align-items: center;
    gap: 5px;
}

.tooltip-value {
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tooltip-value.success {
    color: #06d6a0;
}

.tooltip-value.warning {
    color: #ffbe0b;
}

.tooltip-bandwidth {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--card-border);
}

.tooltip-badge {
    background: rgba(58, 134, 255, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .map-container {
        height: 500px;
    }
    
    .map-overlay {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        padding: 15px;
    }
    
    .map-controls {
        bottom: 10px;
        right: 10px;
    }
    
    .node-tooltip {
        min-width: 220px;
        padding: 15px;
        font-size: 0.9rem;
    }
    
    .tooltip-title {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .map-container {
        height: 400px;
    }
    
    .map-overlay {
        padding: 10px;
    }
    
    .map-stat {
        font-size: 0.85rem;
    }
    
    .map-stat-value {
        font-size: 1rem;
    }
    
    .map-legend {
        margin-top: 10px;
        padding-top: 10px;
    }
    
    .legend-item {
        font-size: 0.8rem;
    }
}