/* Village Bubbles Visualization Styles */

.bubble-canvas {
    position: relative;
    width: 100%;
    height: calc(100vh - 100px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.bubble-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 1rem;
    z-index: 100;
    flex-wrap: wrap;
}

.bubble-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.bubble-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.zoom-controls {
    display: flex;
    gap: 0.5rem;
}

.zoom-controls button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.zoom-controls button:hover {
    background: white;
    transform: scale(1.1);
}

.bubble-viewport {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.connection-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.bubble-layer {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
    z-index: 2;
}

.village-bubble {
    position: absolute;
    cursor: grab;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.village-bubble:active {
    cursor: grabbing;
}

.village-bubble.category-bubble {
    border: 4px solid rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 8px 25px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

.village-bubble.member-bubble {
    border: 2px solid rgba(255, 255, 255, 0.6);
    box-shadow: 
        0 4px 15px rgba(0,0,0,0.15),
        inset 0 1px 0 rgba(255,255,255,0.4);
}

.bubble-icon {
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.bubble-title {
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.member-count {
    background: rgba(0,0,0,0.3);
    padding: 2px 6px;
    border-radius: 10px;
    margin-top: 3px;
    backdrop-filter: blur(5px);
}

.bubble-info-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 350px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 1000;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.2);
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.info-header h3 {
    margin: 0;
    font-weight: 600;
}

.info-header button {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.info-header button:hover {
    background: rgba(255,255,255,0.2);
}

.info-content {
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.bubble-category-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.category-description p {
    margin: 0;
    color: #666;
    line-height: 1.6;
}

.category-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
}

.category-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bubble-member-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
}

.member-avatar {
    font-size: 3rem;
    margin: 0 auto;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-details p {
    margin: 0.5rem 0;
    color: #666;
}

.member-actions {
    display: flex;
    gap: 0.75rem;
}

.bubble-notification {
    animation: slideInRight 0.3s ease;
    font-weight: 500;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Bubble hover effects and animations */
.village-bubble:hover {
    filter: brightness(1.1);
}

.village-bubble.dragging {
    z-index: 1000;
    filter: brightness(1.2) drop-shadow(0 10px 30px rgba(0,0,0,0.4));
}

/* Connection lines between bubbles */
.connection-line {
    stroke: rgba(255,255,255,0.3);
    stroke-width: 2;
    stroke-dasharray: 5,5;
    animation: dash 20s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: -100;
    }
}

/* Pulse animation for active bubbles */
.village-bubble.active {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255,255,255,0.4);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(255,255,255,0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255,255,255,0);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .bubble-canvas {
        height: calc(100vh - 80px);
    }
    
    .bubble-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .bubble-btn {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .bubble-info-panel {
        width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
        max-width: none;
    }
    
    .category-stats {
        grid-template-columns: 1fr;
    }
    
    .member-actions {
        flex-direction: column;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .bubble-info-panel {
        background: #2c3e50;
        color: white;
        border: 1px solid rgba(255,255,255,0.1);
    }
    
    .info-header {
        border-bottom: 1px solid #34495e;
    }
    
    .stat {
        background: #34495e;
        color: white;
    }
    
    .stat-label {
        color: #bdc3c7;
    }
    
    .category-description p {
        color: #bdc3c7;
    }
    
    .member-details p {
        color: #bdc3c7;
    }
}

/* Accessibility improvements */
.village-bubble:focus {
    outline: 3px solid #3498db;
    outline-offset: 2px;
}

.bubble-btn:focus,
.info-header button:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .bubble-canvas {
        background: white;
        color: black;
    }
    
    .village-bubble {
        border: 2px solid #000;
        background: white !important;
        color: black !important;
    }
    
    .bubble-controls,
    .bubble-info-panel {
        display: none;
    }
}
