/* Custom Styles for DecentraConnect */

/* Font Imports */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* Root Variables */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --accent: #10b981;
    --dark: #0f172a;
    --dark-light: #1e293b;
    --dark-lighter: #334155;
}

/* Global Styles */
* {
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 50%, var(--dark) 100%);
    scroll-behavior: smooth;
}

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

@keyframes glow {
    from {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
    }
    to {
        box-shadow: 0 0 30px rgba(99, 102, 241, 0.7), 0 0 40px rgba(99, 102, 241, 0.3);
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

/* Particle Animation */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.particle-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 8s;
}

.particle-2 {
    top: 40%;
    right: 15%;
    animation-delay: 2s;
    animation-duration: 10s;
}

.particle-3 {
    bottom: 30%;
    left: 20%;
    animation-delay: 4s;
    animation-duration: 12s;
}

.particle-4 {
    top: 60%;
    right: 25%;
    animation-delay: 1s;
    animation-duration: 9s;
}

.particle-5 {
    bottom: 20%;
    right: 10%;
    animation-delay: 3s;
    animation-duration: 11s;
}

/* Navigation Styles */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Feature Cards */
.feature-card {
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass Effect */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Custom Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 9999px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 24px;
    border-radius: 9999px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

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

/* Section Animations */
.section-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.section-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

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

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-dark), var(--accent));
}

/* Loading Animation */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

/* Hover Effects */
.hover-glow:hover {
    animation: glow 2s ease-in-out infinite alternate;
}

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

.hover-lift:hover {
    transform: translateY(-5px);
}

/* Text Effects */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.text-glow {
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

/* Background Patterns */
.bg-pattern {
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(99, 102, 241, 0.15) 1px, transparent 0);
    background-size: 20px 20px;
}

.bg-grid {
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .particle {
        display: none;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .feature-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .section-padding {
        padding: 3rem 0;
    }
}

/* Dark Mode Enhancements */
.dark-card {
    background: linear-gradient(135deg, 
        rgba(30, 41, 59, 0.8) 0%, 
        rgba(15, 23, 42, 0.9) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Custom Focus States */
button:focus,
a:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Animation Classes for JavaScript */
.fade-in-up {
    animation: slideUp 0.8s ease-out forwards;
}

.fade-in {
    animation: fadeIn 1s ease-out forwards;
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* Stats Counter Animation */
.counter {
    font-variant-numeric: tabular-nums;
}

/* Custom Selection */
::selection {
    background: var(--primary);
    color: white;
}

::-moz-selection {
    background: var(--primary);
    color: white;
}

/* Print Styles */
@media print {
    .no-print {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .particle {
        display: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .feature-card {
        border: 2px solid white;
    }
    
    .btn-primary {
        border: 2px solid white;
    }
}

/* Custom Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: var(--dark-light);
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.1) 100%);
    background-size: 200px 100%;
    background-repeat: no-repeat;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* Real-Time Components Styles */

/* Price Ticker Animation */
.price-ticker {
    display: flex;
    animation: ticker 60s linear infinite;
    white-space: nowrap;
}

@keyframes ticker {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

.price-item {
    display: inline-flex;
    align-items: center;
    margin-right: 3rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.price-item .symbol {
    font-weight: 600;
    margin-right: 0.5rem;
    color: var(--primary);
}

.price-item .price {
    font-weight: 700;
    margin-right: 0.5rem;
    color: white;
}

.price-item .change {
    font-weight: 600;
    font-size: 0.875rem;
}

.price-item .change.positive {
    color: var(--accent);
}

.price-item .change.negative {
    color: #ef4444;
}

/* Crypto Cards */
.crypto-card {
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

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

.crypto-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.5s;
}

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

.crypto-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

.crypto-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.crypto-change {
    font-weight: 600;
    font-size: 0.875rem;
}

.crypto-change.positive {
    color: var(--accent);
}

.crypto-change.negative {
    color: #ef4444;
}

/* Network Stats Cards */
.network-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.network-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.2);
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-good {
    background-color: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.status-warning {
    background-color: #f59e0b;
    box-shadow: 0 0 10px #f59e0b;
}

.status-error {
    background-color: #ef4444;
    box-shadow: 0 0 10px #ef4444;
}

/* Market Data Display */
.market-stat {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.3s ease;
}

.market-stat:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.metric-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Loading States */
.loading-shimmer {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.1) 100%);
    background-size: 200px 100%;
    background-repeat: no-repeat;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* Data Update Indicators */
.data-fresh {
    position: relative;
}

.data-fresh::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.data-stale {
    opacity: 0.7;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 1rem;
}

/* Error States */
.error-state {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.75rem;
    border-radius: 0.5rem;
    text-align: center;
}

/* Success States */
.success-state {
    color: var(--accent);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.75rem;
    border-radius: 0.5rem;
    text-align: center;
}

/* Mobile Responsive Updates */
@media (max-width: 768px) {
    .price-ticker {
        animation-duration: 45s;
    }
    
    .price-item {
        margin-right: 2rem;
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .crypto-card {
        margin-bottom: 1rem;
    }
    
    .metric-value {
        font-size: 1.25rem;
    }
}

@media (max-width: 640px) {
    .price-ticker {
        animation-duration: 30s;
    }
    
    .price-item {
        margin-right: 1.5rem;
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .crypto-price {
        font-size: 1.25rem;
    }
}
