/* Orbet.io - Space Theme CSS */

/* Stars Background */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.stars, .stars2, .stars3 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

.stars {
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 60px 70px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 50px 50px, #ddd, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 130px 80px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 90px 10px, #eee, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: zoom 20s alternate infinite;
    opacity: 0.5;
}

.stars2 {
    background-image: 
        radial-gradient(1px 1px at 100px 150px, #ddd, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 200px 250px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 300px 350px, #eee, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 250px 200px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 150px 100px, #ddd, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 400px 400px;
    animation: zoom 30s alternate infinite;
    opacity: 0.3;
}

.stars3 {
    background-image: 
        radial-gradient(1px 1px at 300px 200px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 400px 300px, #eee, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 500px 400px, #ddd, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 450px 350px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 550px 250px, #eee, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 600px 600px;
    animation: zoom 40s alternate infinite;
    opacity: 0.2;
}

@keyframes zoom {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.2);
    }
}

/* Shooting Stars */
.shooting-star {
    position: absolute;
    top: 50%;
    left: 0;
    width: 2px;
    height: 2px;
    background: white;
    box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.5);
    animation: shoot 3s linear infinite;
    opacity: 0;
}

@keyframes shoot {
    0% {
        transform: translateX(0) translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateX(1000px) translateY(500px);
        opacity: 0;
    }
}

/* PnL Widget Space Theme */
.pnl-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 480px;
    background: rgba(26, 31, 58, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(157, 123, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 9998;
    transition: all 0.3s ease;
}

.pnl-widget.minimized {
    width: 200px;
}

.pnl-widget.minimized .pnl-body {
    display: none;
}

.pnl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(157, 123, 255, 0.1);
    border-radius: 16px 16px 0 0;
    border-bottom: 1px solid rgba(157, 123, 255, 0.2);
    cursor: move;
    user-select: none;
}

.pnl-header span {
    font-weight: 600;
    color: var(--primary);
}

.pnl-controls {
    display: flex;
    gap: 8px;
}

.pnl-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(157, 123, 255, 0.2);
    color: var(--primary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pnl-btn:hover {
    background: rgba(157, 123, 255, 0.3);
    transform: scale(1.1);
}

.pnl-body {
    padding: 16px;
}

#pnl-canvas {
    width: 100%;
    height: 200px;
    margin-bottom: 16px;
    border-radius: 8px;
    background: rgba(10, 14, 26, 0.5);
}

.pnl-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pnl-stat {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(157, 123, 255, 0.1);
    border-radius: 8px;
    font-size: 14px;
}

.pnl-stat span:first-child {
    color: var(--text-secondary);
}

.pnl-profit {
    font-weight: 600;
    color: var(--success);
}

.pnl-profit.negative {
    color: var(--danger);
}

/* Scrollbar Space Theme */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(26, 31, 58, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

/* Glow Effects */
.glow-effect {
    position: relative;
}

.glow-effect::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    filter: blur(10px);
}

.glow-effect:hover::before {
    opacity: 0.7;
}

/* Planet Orbit Animation */
@keyframes orbit {
    0% {
        transform: rotate(0deg) translateX(100px) rotate(0deg);
    }
    100% {
        transform: rotate(360deg) translateX(100px) rotate(-360deg);
    }
}

.orbit-element {
    animation: orbit 20s linear infinite;
}

/* Nebula Effect */
.nebula-bg {
    background: radial-gradient(ellipse at center, 
        rgba(157, 123, 255, 0.2) 0%, 
        rgba(91, 76, 138, 0.1) 50%, 
        transparent 100%);
    animation: pulse 4s ease-in-out infinite;
}

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

/* Card Hover Effects */
.space-card {
    position: relative;
    overflow: hidden;
}

.space-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(157, 123, 255, 0.2), 
        transparent);
    transition: left 0.5s ease;
}

.space-card:hover::after {
    left: 100%;
}

/* Responsive PnL Widget */
@media (max-width: 768px) {
    .pnl-widget {
        width: calc(100% - 40px);
        bottom: 10px;
        right: 20px;
        left: 20px;
    }
    
    .pnl-widget.minimized {
        width: 160px;
        left: auto;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(157, 123, 255, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Tooltip */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: rgba(26, 31, 58, 0.95);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    border: 1px solid rgba(157, 123, 255, 0.3);
}

.tooltip:hover::after {
    opacity: 1;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: rgba(0, 255, 136, 0.2);
    color: var(--success);
}

.badge-warning {
    background: rgba(255, 170, 0, 0.2);
    color: var(--warning);
}

.badge-danger {
    background: rgba(255, 68, 68, 0.2);
    color: var(--danger);
}

.badge-info {
    background: rgba(0, 204, 255, 0.2);
    color: var(--info);
}
