/* css/components/earth-panel.css */
/* СТИЛИ ДЛЯ ПРАВОЙ ПАНЕЛИ УРОВНЯ "ЗЕМЛЯ" */

.earth-control-panel {
    width: 320px;
    min-width: 280px;
    max-width: 400px;
    background: var(--bg-surface);
    border-left: 1px solid var(--border-color);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    position: relative;
    backdrop-filter: blur(10px);
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.1);
    height: 100%;
    overflow: hidden;
}

/* Ресайзер */
.earth-resizer {
    position: absolute;
    left: -5px;
    top: 0;
    width: 10px;
    height: 100%;
    cursor: col-resize;
    z-index: 1000;
    background: transparent;
}

.earth-resizer:hover::after,
.earth-resizer.dragging::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60px;
    background: var(--accent-purple);
    border-radius: 2px;
}

/* Контейнер скролла */
.earth-scroll-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
    margin-right: -0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-height: 0;
    scroll-behavior: smooth;
}

.earth-scroll-container::-webkit-scrollbar {
    width: 6px;
}

.earth-scroll-container::-webkit-scrollbar-track {
    background: transparent;
    margin: 4px 0;
}

.earth-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

/* Секции */
.earth-section {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: var(--bg-surface);
    overflow: hidden;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

/* Уровни */
.earth-section.level-3 {
    border-left: 4px solid rgba(245, 158, 11, 0.8);
    background: linear-gradient(135deg, 
        rgba(245, 158, 11, 0.03) 0%, 
        rgba(245, 158, 11, 0.01) 100%);
}

.earth-section.level-4 {
    border-left: 4px solid rgba(139, 92, 246, 0.8);
    background: linear-gradient(135deg, 
        rgba(139, 92, 246, 0.03) 0%, 
        rgba(139, 92, 246, 0.01) 100%);
}

/* Заголовки секций */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: default;
    user-select: none;
}

.section-header .section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-count {
    margin-left: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
}

/* Контент секций */
.section-content {
    padding: 1rem;
}

.empty-state {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-tertiary);
    opacity: 0.4;
}

/* СТАТИСТИКА */
.earth-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.earth-stat-item {
    text-align: center;
    padding: 1rem 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    transition: all 0.2s;
}

.earth-stat-item:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
}

.earth-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.earth-stat-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* БЫСТРЫЕ ДЕЙСТВИЯ */
.earth-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.earth-action-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    min-height: 70px;
}

.earth-action-button:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--accent-purple);
    color: var(--accent-purple);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.earth-action-button i {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s;
}

.earth-action-button:hover i {
    transform: scale(1.1);
}

.action-label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.action-hint {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    opacity: 0.7;
    line-height: 1.2;
}

.earth-action-button:hover .action-hint {
    color: var(--accent-purple);
    opacity: 1;
}

/* ВИЗУАЛИЗАЦИЯ */
.earth-visualization-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.earth-visual-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    width: 100%;
    border: none;
    outline: none;
}

.earth-visual-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
    color: var(--accent-purple);
    transform: translateY(-2px);
}

.earth-visual-btn.active {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

.earth-visual-btn i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    transition: all 0.3s;
}

.earth-visual-btn:hover i {
    transform: scale(1.1);
}

.earth-visual-btn .btn-text {
    flex: 1;
}

.earth-visual-btn .btn-label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.1rem;
}

.earth-visual-btn .btn-hint {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    opacity: 0.7;
}

.earth-visual-btn.active .btn-hint {
    color: var(--accent-purple);
    opacity: 1;
    font-weight: 500;
}

/* ДНИ */
.earth-days-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 250px;
    overflow-y: auto;
    padding: 0.5rem 0.25rem 0.5rem 0;
}

.earth-day-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
}

.earth-day-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(59, 130, 246, 0.3);
}

.earth-day-item.highlighted {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-blue);
}

.earth-day-info {
    flex: 1;
}

.earth-day-date {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.earth-day-stats {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.earth-day-toggle {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.earth-day-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-blue);
}

/* ЦЕЛИ */
.earth-goals-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 350px;
    overflow-y: auto;
    padding: 0.5rem 0.25rem 0.5rem 0;
}

.earth-goals-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.earth-goals-group-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0 0.25rem;
    margin-bottom: 0.25rem;
}

.earth-goal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
}

.earth-goal-item:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--accent-orange);
}

.earth-goal-item.highlighted {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--accent-orange);
}

.earth-goal-info {
    flex: 1;
    min-width: 0;
}

.earth-goal-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.earth-goal-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.earth-progress-bar {
    height: 100%;
    background: var(--accent-orange);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.earth-goal-item.completed .earth-progress-bar {
    background: var(--accent-green);
}

.earth-progress-text {
    position: absolute;
    right: 0;
    top: -18px;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.earth-goal-status {
    margin-left: 1rem;
    font-size: 1rem;
}

.earth-goal-status.completed {
    color: var(--accent-green);
}

/* Оптимизация размеров */
.section-content {
    padding: 0.75rem;
}

.earth-stat-item {
    padding: 0.6rem 0.5rem;
}

.earth-stat-value {
    font-size: 1.25rem;
}

.earth-action-button {
    min-height: 60px;
    padding: 0.5rem 0.25rem;
}

.earth-action-button i {
    font-size: 1.1rem;
}

/* Адаптивность панели */
@media (max-width: 992px) {
    .earth-control-panel {
        width: 100% !important;
        height: 350px;
        max-height: 350px;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
    
    .earth-resizer {
        position: relative;
        left: 0;
        top: -4px;
        width: 100%;
        height: 8px;
        cursor: row-resize;
    }
    
    .earth-resizer:hover::after,
    .earth-resizer.dragging::after {
        left: 50%;
        top: 2px;
        transform: translateX(-50%);
        width: 60px;
        height: 4px;
    }
    
    .earth-quick-actions {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .earth-control-panel {
        padding: 0.75rem;
    }
    
    .earth-quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .earth-days-list,
    .earth-goals-list {
        max-height: 200px;
    }
}

@media (max-width: 576px) {
    .section-header {
        padding: 0.5rem 0.75rem;
    }
    
    .section-content {
        padding: 0.75rem;
    }
    
    .earth-visualization-controls {
        grid-template-columns: 1fr;
    }
}