/* css/components/cloud-visualization.css */
/* Стили для визуализации облаков */

/* Контейнер облака */
.cloud-container {
    position: absolute;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    z-index: 1;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
    transform-origin: center;
}

/* Эффект парения */
.cloud-container:hover {
    animation: cloudFloat 3s ease-in-out infinite;
    z-index: 1000 !important;
}

/* Состояние перетаскивания */
.cloud-container.dragging {
    cursor: grabbing !important;
    z-index: 10000 !important;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.4));
    opacity: 0.95;
}

/* Состояние наведения */
.cloud-container.hovered {
    animation: cloudPulse 1.5s ease-in-out infinite;
    z-index: 500 !important;
}

/* Основное облако */
.cloud-main {
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 
        inset 0 0 50px rgba(255, 255, 255, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

/* Градиент для облака */
.cloud-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: radial-gradient(
        circle at 30% 30%,
        rgba(255, 255, 255, 0.15) 0%,
        transparent 70%
    );
    opacity: 0.6;
    transition: opacity 0.3s;
}

.cloud-container:hover .cloud-gradient {
    opacity: 0.8;
}

/* Внутренние кружочки (частицы облака) */
.cloud-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.cloud-particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 
        inset 0 0 8px rgba(255, 255, 255, 0.2),
        0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.cloud-container:hover .cloud-particle {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 
        inset 0 0 12px rgba(255, 255, 255, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Эмодзи в центре облака */
.cloud-emoji {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
    transition: all 0.3s ease;
}

.cloud-container:hover .cloud-emoji {
    transform: translate(-50%, -50%) scale(1.1);
}

/* Название пространства под облаком */
.cloud-label {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0.75rem;
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    white-space: nowrap;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    min-width: 120px;
    text-align: center;
}

.cloud-label::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-bottom-color: var(--border-color);
}

.cloud-label::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-bottom-color: var(--bg-surface);
}

.cloud-label-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    display: block;
}

.cloud-label-stats {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

/* Показываем лейбл при наведении */
.cloud-container:hover .cloud-label {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    margin-top: 1rem;
}

/* Индикатор избранного */
.cloud-favorite {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 32px;
    height: 32px;
    background: var(--accent-orange);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
    animation: pulse 2s infinite;
}

.cloud-favorite i {
    font-size: 0.9rem;
}

/* Индикатор системного пространства */
.cloud-system {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 24px;
    height: 24px;
    background: var(--bg-surface);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    z-index: 20;
    border: 2px solid var(--border-color);
    font-size: 0.7rem;
}

/* Сетка для авторазмещения */
.cloud-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.1;
}

.grid-line {
    position: absolute;
    background: var(--accent-blue);
    border-radius: 1px;
}

.grid-line.horizontal {
    width: 100%;
    height: 1px;
    left: 0;
}

.grid-line.vertical {
    width: 1px;
    height: 100%;
    top: 0;
}

/* Подсветка при выборе */
.cloud-selection-ring {
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    border: 3px solid var(--accent-blue);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    animation: selectionPulse 2s infinite;
}

.cloud-container.selected .cloud-selection-ring {
    opacity: 1;
}

@keyframes selectionPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 0.3; }
}

/* Анимации */
@keyframes cloudFloat {
    0%, 100% { 
        transform: translateY(0) rotate(0deg); 
    }
    50% { 
        transform: translateY(-8px) rotate(0.3deg); 
    }
}

@keyframes cloudPulse {
    0%, 100% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.08); 
    }
}

@keyframes particleFloat {
    0%, 100% { 
        transform: translate(0, 0); 
    }
    25% { 
        transform: translate(2px, -2px); 
    }
    50% { 
        transform: translate(0, -4px); 
    }
    75% { 
        transform: translate(-2px, -2px); 
    }
}

/* Размеры облаков */
.cloud-size-xs .cloud-main { width: 80px; height: 80px; }
.cloud-size-xs .cloud-emoji { font-size: 2rem; }
.cloud-size-xs .cloud-label { padding: 0.4rem 0.8rem; font-size: 0.9rem; }

.cloud-size-sm .cloud-main { width: 120px; height: 120px; }
.cloud-size-sm .cloud-emoji { font-size: 2.5rem; }

.cloud-size-md .cloud-main { width: 160px; height: 160px; }
.cloud-size-md .cloud-emoji { font-size: 3rem; }

.cloud-size-lg .cloud-main { width: 200px; height: 200px; }
.cloud-size-lg .cloud-emoji { font-size: 3.5rem; }

.cloud-size-xl .cloud-main { width: 240px; height: 240px; }
.cloud-size-xl .cloud-emoji { font-size: 4rem; }

/* Цветовые вариации */
.cloud-color-work .cloud-main { 
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(59, 130, 246, 0.7));
}
.cloud-color-study .cloud-main { 
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.9), rgba(16, 185, 129, 0.7));
}
.cloud-color-personal .cloud-main { 
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.9), rgba(139, 92, 246, 0.7));
}
.cloud-color-other .cloud-main { 
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.9), rgba(100, 116, 139, 0.7));
}

/* Эффект при клике */
.cloud-container:active .cloud-main {
    transform: scale(0.95);
}

/* Состояние неактивности */
.cloud-container.inactive {
    opacity: 0.5;
    filter: grayscale(0.8) brightness(0.7);
    pointer-events: none;
}

/* Адаптивность */
@media (max-width: 768px) {
    .cloud-container {
        transform: scale(0.8);
    }
    
    .cloud-label {
        display: none; /* На мобильных скрываем лейблы */
    }
    
    .cloud-container:hover .cloud-label {
        display: block;
        position: fixed;
        top: auto;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 300px;
        white-space: normal;
        text-align: center;
    }
}

/* Печать */
@media print {
    .cloud-container {
        filter: none !important;
        box-shadow: none !important;
        break-inside: avoid;
    }
    
    .cloud-label {
        background: white;
        color: black;
        border: 1px solid #ccc;
    }
}