/* BrainBubbles Mobile Component Styles */

.brainbubbles-mobile {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-height: 200px;
    margin-bottom: 16px;
    gap: 16px;
    box-sizing: border-box;
}

.brainbubbles-mobile .title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.brainbubbles-mobile .title-text {
    font-family: "Metropolis Semi Bold";
    color: var(--text-color, #4b4a4a);
    font-size: 15px;
    letter-spacing: 0.17px;
}

.brainbubbles-mobile .card {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background-color: var(--cards-background, #ffffff);
    box-shadow: 0 4px 4px 0 #dff4ff;
    border: none;
    position: relative;
    overflow: hidden; /* Ensure bubbles don't overflow */
}

.brainbubbles-mobile .subtitle {
    font-family: "Metropolis Semi Bold";
    color: var(--text-color, #4b4a4a);
    font-size: 15px;
    letter-spacing: 0.17px;
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    font-weight: 600;
}

.brainbubbles-mobile .brainbubbles-container {
    position: relative;
    min-height: 180px;
    width: 100%;
    padding: 12px;
    box-sizing: border-box;
    overflow: hidden; /* Prevent bubbles from going outside container */
}

.brainbubbles-mobile .bubble-mobile {
    position: absolute;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
    padding-top: 2px;
    z-index: 1;
}

.brainbubbles-mobile .bubble-mobile:hover {
    transform: scale(1.05) translate(-50%, -50%);
    z-index: 2;
}

.brainbubbles-mobile .bubble-mobile img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    position: relative;
    top: -5px;
}

.brainbubbles-mobile .bubble-mobile div {
    color: white;
    font-family: "Metropolis", sans-serif;
    font-weight: bold;
    font-size: 10px;
    letter-spacing: 0.15px;
    position: relative;
    top: -5px;
    width: 88%;
    text-align: center;
    padding: 0 2px;
}

/* Cover message styles for mobile */
.brainbubbles-mobile .cover-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    text-align: center;
}

.brainbubbles-mobile .cover-message-title {
    font-family: "Metropolis Semi Bold";
    font-weight: bold;
    font-size: 16px;
    color: var(--text-color, #4b4a4a);
    margin-bottom: 10px;
}

.brainbubbles-mobile .cover-message-text {
    font-family: "Metropolis Semi Bold";
    font-size: 13px;
    color: var(--text-color, #4b4a4a);
    line-height: 1.4;
}

.brainbubbles-mobile .cover-message-text .highlight {
    color: var(--primary-color, #667eea);
    font-weight: bold;
}

/* Dark theme support for mobile */
.dark .brainbubbles-mobile .card {
    background-color: var(--cards-background, #1f2120);
    box-shadow: none;
}

.dark .brainbubbles-mobile .title .title-text,
.dark .brainbubbles-mobile .subtitle,
.dark .brainbubbles-mobile .cover-message-title,
.dark .brainbubbles-mobile .cover-message-text {
    color: var(--text-color, #ffffff);
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .brainbubbles-mobile {
        min-height: 160px;
        gap: 12px;
    }
    
    .brainbubbles-mobile .brainbubbles-container {
        height: 350px;
        padding: 10px;
    }
    
    .brainbubbles-mobile .title-text {
        font-size: 18px;
    }
    
    .brainbubbles-mobile .subtitle {
        font-size: 14px;
        top: 10px;
        left: 10px;
    }
    
    .brainbubbles-mobile .bubble-mobile div {
        font-size: 14px;
    }
    
    .brainbubbles-mobile .bubble-mobile img {
        width: 20px;
        height: 20px;
    }
    
    .brainbubbles-mobile .cover-message-title {
        font-size: 15px;
    }
    
    .brainbubbles-mobile .cover-message-text {
        font-size: 12px;
    }
}

/* Landscape orientation adjustments for mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .brainbubbles-mobile .brainbubbles-container {
        height: 140px;
        padding: 10px;
    }
    
    .brainbubbles-mobile .bubble-mobile div {
        font-size: 14px;
    }
    
    .brainbubbles-mobile .bubble-mobile img {
        width: 20px;
        height: 20px;
    }
}

/* Ensure bubbles never overflow the container */
.brainbubbles-mobile .brainbubbles-container {
    position: relative;
    overflow: hidden;
}

.brainbubbles-mobile .bubble-mobile {
    /* Ensure bubbles are positioned within bounds */
    max-width: calc(100% - 24px); /* Account for padding and margins */
    max-height: calc(100% - 24px);
}

/* Mobile-specific grid layout constraints */
.brainbubbles-mobile .bubble-mobile {
    /* Ensure bubbles don't exceed container width */
    box-sizing: border-box;
}

/* Touch-friendly hover states for mobile */
@media (hover: none) and (pointer: coarse) {
    .brainbubbles-mobile .bubble-mobile:hover {
        transform: translate(-50%, -50%) scale(1);
    }
    
    .brainbubbles-mobile .bubble-mobile:active {
        transform: translate(-50%, -50%) scale(0.95);
    }
}
