/* ==========================================================================
   Virtual Bouncy Balls Tool - Zhween Brand Styling
   ========================================================================== */

.vbb-container {
        --primary-color: #15aebf;
        --primary-light: #4ecdc4;
        --primary-dark: #0e9bb2;
        --secondary-color: #ff6b35;
        --secondary-light: #ff8c5a;
        --accent-color: #ffd93d;
        --success-color: #00b894;
        --danger-color: #e17055;
        --warning-color: #fdcb6e;
        --white: #ffffff;
        --gray-100: #f1f3f4;
        --gray-200: #e9ecef;
        --gray-300: #dee2e6;
        --gray-400: #ced4da;
        --gray-500: #adb5bd;
        --gray-600: #6c757d;
        --gray-700: #495057;
        --gray-800: #343a40;
        --text-primary: #2d3748;
        --text-secondary: #4a5568;
        --radius-lg: 0.75rem;
        --radius-xl: 1rem;
        --radius-2xl: 1.25rem;
        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
        --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
        --bg-gradient: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    }

    .vbb-wrapper {
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 95vh;
        padding: 0;
        gap: 0;
        background: #1a8a9d;
        align-items: center;
        overflow: hidden;
        position: relative;
    }

    .vbb-game-container {
        position: relative;
        width: 100%;
        height: 100%;
        flex: 1;
        background: #1a8a9d;
        overflow: hidden;
        cursor: crosshair;
        min-height: 400px;
    }

    /* Top overlay - controls, mic status and volume */
    .vbb-top-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        padding: 0.75rem;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        z-index: 100;
        pointer-events: none;
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, transparent 100%);
    }

    .vbb-top-overlay > * {
        pointer-events: auto;
    }

    .vbb-top-row {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .vbb-mic-status {
        padding: 0.5rem 1rem;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border-radius: var(--radius-lg);
        font-size: 0.8125rem;
        font-weight: 600;
        transition: all 0.3s ease;
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: var(--white);
        white-space: nowrap;
    }

    .vbb-mic-status.active {
        background: rgba(0, 184, 148, 0.4);
        border-color: var(--success-color);
        color: #7dffcc;
    }

    .vbb-mic-status.inactive {
        background: rgba(225, 112, 85, 0.4);
        border-color: var(--danger-color);
        color: #ffb8a8;
    }

    .vbb-volume-row {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
    }

    .vbb-volume-meter {
        flex: 1;
        height: 8px;
        background: rgba(255, 255, 255, 0.15);
        border-radius: var(--radius-full);
        overflow: hidden;
    }

    .vbb-volume-bar {
        height: 100%;
        width: 0%;
        background: var(--bg-gradient);
        border-radius: var(--radius-full);
        transition: width 0.05s linear;
    }

    .vbb-watermark {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 200px;
        opacity: 0.08;
        pointer-events: none;
        z-index: 1;
        filter: brightness(2);
    }

    .vbb-ball {
        position: absolute;
        border-radius: 50%;
        cursor: pointer;
        z-index: 10;
        will-change: left, top, transform;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }

    .vbb-ball:hover {
        filter: brightness(1.1);
        transform: scale(1.1);
    }

    .vbb-controls {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.375rem;
    }

    .vbb-btn {
        padding: 0.5rem 0.75rem;
        border-radius: var(--radius-full);
        font-weight: 600;
        font-size: 0.8125rem;
        transition: all 0.2s ease;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.375rem;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        cursor: pointer;
    }

    .vbb-btn-secondary {
        background: rgba(255, 255, 255, 0.2);
        color: var(--white);
    }

    .vbb-btn-secondary:hover {
        background: rgba(255, 255, 255, 0.35);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        color: var(--white);
    }

    .vbb-btn-add {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-light);
    }

    .vbb-btn-add:hover {
        background: var(--primary-dark);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(21, 174, 191, 0.4);
        color: white;
    }

    .vbb-btn-mic-off {
        background: var(--danger-color);
        color: white;
        border-color: #ff8a75;
    }

    .vbb-btn-mic-off:hover {
        background: #c9604a;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(225, 112, 85, 0.4);
        color: white;
    }

    .vbb-btn-mic-on {
        background: var(--success-color);
        color: white;
        border-color: #4dd4b4;
    }

    .vbb-btn-mic-on:hover {
        background: #009d7a;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 184, 148, 0.4);
        color: white;
    }

    .vbb-stats {
        display: flex;
        gap: 0.5rem;
        flex-shrink: 0;
    }

    .vbb-stat-card {
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        padding: 0.25rem 0.625rem;
        border-radius: var(--radius-lg);
        border: 1px solid rgba(255, 255, 255, 0.1);
        display: flex;
        align-items: center;
        gap: 0.375rem;
    }

    .vbb-stat-value {
        font-size: 0.875rem;
        font-weight: 700;
        color: var(--white);
    }

    .vbb-stat-label {
        font-size: 0.625rem;
        color: rgba(255, 255, 255, 0.6);
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    @keyframes vbb-ball-create {
        0% { transform: scale(0); opacity: 0; }
        100% { transform: scale(1); opacity: 1; }
    }

    .vbb-ball.created {
        animation: vbb-ball-create 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    @keyframes vbb-ball-remove {
        0% { transform: scale(1); opacity: 1; }
        100% { transform: scale(0); opacity: 0; }
    }

    .vbb-ball.removing {
        animation: vbb-ball-remove 0.3s ease-in forwards;
    }

    [dir="rtl"] .vbb-wrapper {
        direction: rtl;
    }

    @media (max-width: 600px) {
        .vbb-wrapper { padding: 0; }
        .vbb-top-overlay { padding: 0.5rem; }
        .vbb-top-row { gap: 0.5rem; }
        .vbb-mic-status { font-size: 0.6875rem; padding: 0.375rem 0.625rem; }
        .vbb-btn { padding: 0.375rem 0.5rem; font-size: 0.6875rem; }
        .vbb-btn span:last-child { display: none; }
        .vbb-btn-mic-off span:last-child,
        .vbb-btn-mic-on span:last-child,
        .vbb-btn-add span:last-child { display: inline; }
        .vbb-volume-row { flex-wrap: wrap; }
        .vbb-stat-card { padding: 0.25rem 0.5rem; }
        .vbb-stat-value { font-size: 0.75rem; }
        .vbb-stat-label { font-size: 0.5rem; }
    }

    @media (prefers-reduced-motion: reduce) {
        .vbb-ball.created, .vbb-ball.removing { animation: none; }
    }
