/* ========================================
   ArbiInvest - Анимации
   ======================================== */

/* Экран приветствия */
.welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #0c0d0e 0%, #1a1a1f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    overflow: hidden;
}

.welcome-screen::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

.welcome-container {
    position: relative;
    z-index: 1;
    max-width: 800px;
    width: 90%;
    padding: 40px;
}

.welcome-header {
    display: flex;
    justify-content: center;
    margin-bottom: 60px;
    animation: slideDown 0.8s ease-out;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    color: #6366f1;
    animation: rotate 20s linear infinite;
}

.logo-text {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

/* Контейнер для печатания текста */
.typing-container {
    min-height: 300px;
    padding: 40px;
    background: rgba(32, 33, 36, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(42, 43, 47, 0.5);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.typing-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #6366f1, transparent);
    animation: shimmer 3s ease-in-out infinite;
}

.typing-text {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #e3e3e3;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 0.3px;
}

.typing-paragraph {
    margin-bottom: 20px;
    animation: fadeInText 0.3s ease-in;
}

.typing-paragraph:last-child {
    margin-bottom: 0;
}

/* Курсор */
.cursor {
    display: inline-block;
    width: 3px;
    height: 24px;
    background: #6366f1;
    margin-left: 2px;
    animation: blink 1s infinite;
    vertical-align: text-bottom;
}

/* Кнопка входа */
.enter-button {
    margin-top: 40px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    margin-right: auto;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.enter-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.enter-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.enter-button:hover::before {
    left: 100%;
}

.enter-button:active {
    transform: translateY(0);
}

.enter-button svg {
    transition: transform 0.3s ease;
}

.enter-button:hover svg {
    transform: translateX(4px);
}

/* Основное приложение */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Статус подключения */
.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(32, 33, 36, 0.6);
    border: 1px solid rgba(42, 43, 47, 0.5);
    border-radius: 20px;
    font-size: 0.875rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6b6b6b;
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.connected {
    background: #10b981;
}

.status-dot.connecting {
    background: #f59e0b;
    animation: pulse 1s ease-in-out infinite;
}

.status-dot.error {
    background: #ef4444;
}

.status-text {
    color: #a0a0a0;
}

/* Карточки статистики */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: #202124;
    border: 1px solid #2a2b2f;
    border-radius: 12px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #6366f1, transparent);
    transform: translateX(-100%);
    animation: slideRight 3s ease-in-out infinite;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border-color: #35363a;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stat-label {
    font-size: 0.875rem;
    color: #a0a0a0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-badge {
    padding: 4px 8px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 6px;
    font-size: 0.75rem;
    color: #6366f1;
}

.stat-badge.positive {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.stat-badge.negative {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #e3e3e3;
    margin-bottom: 8px;
    font-variant-numeric: tabular-nums;
}

.stat-subvalue {
    font-size: 0.875rem;
    color: #6b6b6b;
}

/* График */
.chart-container {
    background: #202124;
    border: 1px solid #2a2b2f;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.chart-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #e3e3e3;
}

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

.chart-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #2a2b2f;
    border-radius: 6px;
    color: #a0a0a0;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-btn:hover {
    background: #2a2b2f;
    color: #e3e3e3;
}

.chart-btn.active {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
}

.chart-area {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b6b6b;
}

/* Уведомления */
.notification-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification {
    min-width: 300px;
    max-width: 400px;
    padding: 16px;
    background: #202124;
    border: 1px solid #2a2b2f;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left: 4px solid #10b981;
}

.notification.error {
    border-left: 4px solid #ef4444;
}

.notification.warning {
    border-left: 4px solid #f59e0b;
}

.notification.info {
    border-left: 4px solid #3b82f6;
}

.notification-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
}

.notification.success .notification-icon {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.notification.error .notification-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.notification-content {
    flex: 1;
}

.notification-message {
    color: #e3e3e3;
    font-size: 0.875rem;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

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

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.05);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

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

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

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

/* Кнопка загрузки */
.btn-secondary.loading {
    position: relative;
    color: transparent;
}

.btn-secondary.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #6366f1;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

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

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .welcome-container {
        padding: 20px;
    }
    
    .logo-text {
        font-size: 1.5rem;
    }
    
    .typing-container {
        padding: 24px;
        min-height: 250px;
    }
    
    .typing-text {
        font-size: 1rem;
    }
    
    .enter-button {
        padding: 12px 24px;
        font-size: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .notification-container {
        top: 60px;
        right: 10px;
        left: 10px;
    }
    
    .notification {
        min-width: auto;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .typing-text {
        font-size: 0.9375rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
}