/* css/components/earth-graph.css */
/* СТИЛИ ДЛЯ ГРАФА ЗНАНИЙ УРОВНЯ "ЗЕМЛЯ" */

.earth-container {
    position: fixed;
    top: 0;
    left: 250px;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1f35 100%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

/* Шапка */
.earth-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: rgba(15, 17, 23, 0.95);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Хлебные крошки */
.earth-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.earth-breadcrumbs a {
    color: var(--accent-blue);
    text-decoration: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.earth-breadcrumbs a:hover {
    background: rgba(59, 130, 246, 0.1);
    text-decoration: underline;
}

.earth-breadcrumbs .cloud-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.earth-breadcrumbs .cloud-emoji {
    font-size: 1rem;
}

.earth-breadcrumbs .separator {
    opacity: 0.5;
    margin: 0 0.25rem;
}

.earth-breadcrumbs .current {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.earth-title-emoji {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: rgba(139, 92, 246, 0.2);
}

/* Кнопки действий */
.earth-actions {
    display: flex;
    gap: 0.5rem;
}

.earth-action-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.875rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.earth-action-btn:hover {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: white;
    transform: translateY(-1px);
}

.earth-action-btn i {
    font-size: 0.9rem;
}

.earth-action-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

.earth-action-btn.loading i {
    animation: spin 1s infinite linear;
}

/* Основной контент */
.earth-content {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
}

/* Холст */
.earth-canvas {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: 
        radial-gradient(circle at 20% 30%, rgba(139, 92, 246, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.05) 0%, transparent 40%),
        linear-gradient(135deg, var(--bg-primary) 0%, #1a1f35 100%);
}

/* Панель управления (основные стили в earth-panel.css) */

/* Информационная подсказка */
.earth-hint {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 17, 23, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 50;
    max-width: 500px;
    text-align: center;
}

.earth-hint-keys {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.earth-hint-key {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    font-family: monospace;
}

/* Загрузка */
.earth-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 1.5rem;
    animation: fadeIn 0.3s ease-out;
}

.earth-loading-spinner {
    font-size: 3rem;
    animation: earthFloat 2s ease-in-out infinite;
}

@keyframes earthFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Ошибка */
.earth-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 1rem;
    text-align: center;
    padding: 2rem;
}

.earth-error .error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.earth-error h2 {
    color: var(--accent-red);
    margin-bottom: 0.5rem;
}

.earth-error p {
    color: var(--text-secondary);
    max-width: 500px;
    margin-bottom: 2rem;
}

/* Адаптивность */
@media (max-width: 1400px) {
    .earth-container {
        left: 200px;
    }
}

@media (max-width: 1200px) {
    .earth-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .earth-actions {
        align-self: stretch;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 992px) {
    .earth-container {
        position: relative;
        left: 0;
        height: 100vh;
    }
    
    .earth-content {
        flex-direction: column;
    }
    
    .earth-hint {
        display: none;
    }
}

@media (max-width: 768px) {
    .earth-header {
        padding: 0.75rem 1rem;
    }
    
    .earth-title-emoji {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
    
    .earth-breadcrumbs {
        font-size: 0.85rem;
        flex-wrap: wrap;
    }
    
    .earth-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .earth-action-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Анимации */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Стили для новых элементов */
.earth-goal-thread {
    transition: all 0.3s ease;
}

.earth-goal-thread:hover {
    filter: brightness(1.2);
    stroke-width: 3px;
}

/* Зоны для целей */
.upper-goals-zone {
    border-bottom: 1px dashed rgba(59, 130, 246, 0.2);
}

.lower-goals-zone {
    border-top: 1px dashed rgba(59, 130, 246, 0.2);
}

/* css/components/earth-graph.css */

:root {
    /* Цвета для Земли */
    --earth-bg-start: #0F1117;
    --earth-bg-mid: #1A1F2C;
    --earth-bg-end: #0F1117;
    --earth-grid-color: rgba(59, 130, 246, 0.05);
    
    /* Старт и Финал */
    --start-color: #3B82F6;
    --start-color-dark: #1E40AF;
    --final-color: #FBBF24;
    --final-color-dark: #F59E0B;
    
    /* Заметки */
    --note-color: #8B5CF6;
    --note-color-dark: #6D28D9;
    
    /* Цели */
    --goal-active: #F59E0B;
    --goal-progress: #60A5FA;
    --goal-high: #8B5CF6;
    --goal-complete: #10B981;
}

.earth-canvas {
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.3));
    transition: filter 0.3s ease;
}

.earth-canvas:hover {
    filter: drop-shadow(0 0 15px rgba(59, 130, 246, 0.2));
}

/* Стили для Земли (дополнение к общим стилям) */

/* Ядра (НАЧАЛО и ФИНАЛ) */
.earth-start-node,
.earth-final-node {
    transition: all 0.3s ease;
}

.earth-start-node:hover,
.earth-final-node:hover {
    filter: brightness(1.2);
    transform: scale(1.05);
}

/* Дни (точки на магистрали) */
.earth-day-node {
    transition: all 0.2s ease;
}

.earth-day-node:hover {
    transform: scale(1.5);
    filter: brightness(1.3);
}

/* Заметки (облака) */
.earth-note-node {
    transition: all 0.3s ease;
}

.earth-note-node:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}

/* Магистраль */
.earth-master-line {
    stroke-dasharray: 5, 5;
    animation: flowAnimation 20s linear infinite;
}

@keyframes flowAnimation {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: 100; }
}

/* Контекстное меню для целей - в стиле Стратосферы */
.goal-context-menu {
    position: fixed;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    z-index: 10000;
    min-width: 200px;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.1s ease-out;
    overflow: hidden;
}

.goal-context-menu .context-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.goal-context-menu .context-menu-item:last-child {
    border-bottom: none;
}

.goal-context-menu .context-menu-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
}

.goal-context-menu .context-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}