/**
 * Music Genre Bubbles - Modern Purple Theme
 * Version: 3.6.0
 * Enhanced responsive design for all devices
 */

/* ============================================================================
   FULL SCREEN LAYOUT
   ============================================================================ */
.mgb-fullwidth-container {
    width: 100%;
    max-width: 100vw;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f0e7f7 0%, #e0e7fc 100%);
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow-x: hidden;
}

.mgb-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ============================================================================
   BUBBLE SECTION (LEFT SIDE)
   ============================================================================ */
.mgb-bubble-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 50px 60px;
    position: relative;
}

.mgb-main-title {
    font-size: 45px;
    font-weight: 700;
    background: linear-gradient(135deg, #9333ea 0%, #db2777 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 40px 0;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.mgb-d3-canvas {
    flex: 1;
    position: relative;
    min-height: 400px;
    width: 100%;
    -webkit-tap-highlight-color: transparent;
}

.mgb-d3-canvas svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
}

/* Improved hover areas for SVG bubbles */
.mgb-d3-canvas svg g {
    transition: transform 0.2s ease;
    transform-box: fill-box;
    transform-origin: center;
    cursor: pointer;
}

.mgb-d3-canvas svg g:hover {
    transform: scale(1.05);
    z-index: 10;
}

/* Ensure transparent hit area doesn't interfere with visuals */
.mgb-d3-canvas svg circle[fill="transparent"] {
    cursor: pointer;
}

/* Satellite images layer */
.mgb-sat-layer {
    pointer-events: none;
    z-index: 100;
}

.mgb-sat-layer g {
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.mgb-counter {
    position: absolute;
    bottom: 60px;
    left: 60px;
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #9333ea 0%, #db2777 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 8px 16px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.15);
    z-index: 50;
    backdrop-filter: blur(4px);
}

/* Loading Message */
.mgb-loading-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: 600;
    color: #9333ea;
    text-align: center;
    animation: mgb-pulse 1.5s ease-in-out infinite;
    white-space: nowrap;
    z-index: 10;
}

@keyframes mgb-pulse {
    0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
}

.mgb-error-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    color: #dc2626;
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 10;
}

/* ============================================================================
   PLAYER SECTION (RIGHT SIDE)
   ============================================================================ */
.mgb-player-section {
    width: 500px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    padding: 40px 30px;
    gap: 20px;
    box-shadow: -8px 0 40px rgba(147, 51, 234, 0.1);
    border-left: 1px solid rgba(147, 51, 234, 0.1);
    position: relative;
    z-index: 10;
}

/* ============================================================================
   MUSIC PLAYER
   ============================================================================ */
.mgb-music-player {
    background: #ffffff;
    border-radius: 24px;
    padding: 18px;
    box-shadow: 0 8px 32px rgba(147, 51, 234, 0.12);
    border: 1px solid rgba(147, 51, 234, 0.1);
    display: flex;
    flex-direction: column;
}

.mgb-card1-video {
    margin: 0;
}

.mgb-player-header {
    text-align: center;
    margin-bottom: 12px;
    padding: 14px 10px 0;
}

.mgb-genre-name {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #9333ea 0%, #db2777 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    min-height: 28px;
}

.mgb-genre-detail {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    min-height: 40px;
    max-height: 60px;
    overflow-y: auto;
    padding: 0 4px;
    scrollbar-width: thin;
    scrollbar-color: #9333ea #f0e7f7;
}

.mgb-genre-detail::-webkit-scrollbar {
    width: 4px;
}

.mgb-genre-detail::-webkit-scrollbar-track {
    background: #f0e7f7;
}

.mgb-genre-detail::-webkit-scrollbar-thumb {
    background: #9333ea;
    border-radius: 4px;
}

/* Time Period Controls */
.mgb-time-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
}

.mgb-time-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(147, 51, 234, 0.2);
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: all 0.25s ease;
    padding: 0;
    position: relative;
}

.mgb-time-btn svg {
    transition: all 0.25s ease;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.mgb-time-btn span {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1;
    transition: all 0.25s ease;
}

.mgb-time-btn:hover {
    color: #9333ea;
    border-color: rgba(147, 51, 234, 0.5);
    transform: scale(1.12);
    background: rgba(147, 51, 234, 0.06);
    box-shadow: 0 6px 16px rgba(147, 51, 234, 0.15);
}

.mgb-time-btn.active {
    background: linear-gradient(135deg, #9333ea 0%, #db2777 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(147, 51, 234, 0.35);
    transform: scale(1.05);
}

.mgb-time-btn.active svg {
    fill: #ffffff;
}

/* ============================================================================
   VIDEO PLAYER
   ============================================================================ */
.mgb-video-player {
    background: #ffffff;
    border-radius: 24px;
    padding: 18px;
    box-shadow: 0 8px 32px rgba(147, 51, 234, 0.12);
    border: 1px solid rgba(147, 51, 234, 0.1);
}

.mgb-card2-header {
    text-align: center;
    margin-bottom: 14px;
}

.mgb-card2-title {
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #9333ea 0%, #db2777 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-height: 24px;
}

.mgb-video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 16px;
    background: linear-gradient(135deg, #faf5ff 0%, #f3f4f6 100%);
}

.mgb-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    border: none;
}

.mgb-video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.mgb-video-placeholder svg {
    margin-bottom: 16px;
    opacity: 0.4;
    width: 48px;
    height: 48px;
}

.mgb-placeholder-text {
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8;
    text-align: center;
    padding: 0 20px;
}

/* ============================================================================
   SATELLITE MUSICIAN IMAGES
   ============================================================================ */
.mgb-satellite {
    position: absolute;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), 0 0 0 2px rgba(147, 51, 234, 0.35);
    pointer-events: none;
    z-index: 200;
    animation: mgb-satellite-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
    transform: scale(0.4);
}

.mgb-satellite-hide {
    animation: mgb-satellite-out 0.2s ease forwards !important;
}

@keyframes mgb-satellite-in {
    from { opacity: 0; transform: scale(0.4); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes mgb-satellite-out {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(0.3); }
}

/* ============================================================================
   ADMIN STYLES
   ============================================================================ */
.mgb-wrap {
    max-width: 1400px;
    margin: 20px;
    padding: 20px;
}

.mgb-wrap h1 {
    background: linear-gradient(135deg, #9333ea 0%, #db2777 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 32px;
    margin-bottom: 24px;
}

.mgb-admin-panel {
    display: flex;
    gap: 24px;
    margin-top: 24px;
}

.mgb-add-box {
    width: 400px;
    background: #fff;
    padding: 28px;
    border: 1px solid rgba(147, 51, 234, 0.1);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(147, 51, 234, 0.08);
    flex-shrink: 0;
}

.mgb-add-box h3 {
    margin-top: 0;
    color: #1d2327;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid rgba(147, 51, 234, 0.1);
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.mgb-add-box p {
    margin: 16px 0;
}

.mgb-add-box label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.mgb-add-box input[type="text"],
.mgb-add-box input[type="url"],
.mgb-add-box textarea,
.mgb-add-box select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.mgb-add-box input[type="text"]:focus,
.mgb-add-box input[type="url"]:focus,
.mgb-add-box textarea:focus,
.mgb-add-box select:focus {
    border-color: #9333ea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

/* Image Upload Styles */
.mgb-image-upload-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mgb-image-upload-row .mgb-image-url-input {
    flex: 1;
}

.mgb-upload-btn {
    white-space: nowrap;
    flex-shrink: 0;
    background: linear-gradient(135deg, #9333ea 0%, #db2777 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 8px 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    font-size: 13px !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 8px rgba(147,51,234,0.25) !important;
}

.mgb-upload-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(147,51,234,0.4) !important;
}

.mgb-upload-btn:active {
    transform: translateY(0) !important;
}

.mgb-image-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 3px solid rgba(147, 51, 234, 0.3);
    margin-top: 8px;
    display: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: all 0.2s ease;
}

.mgb-image-preview[style*="display: block"] {
    animation: mgb-preview-in 0.3s ease;
}

@keyframes mgb-preview-in {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* Color Input */
.mgb-color-input {
    width: 100%;
    height: 48px !important;
    padding: 4px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mgb-color-input:hover {
    border-color: #9333ea;
}

/* YouTube Fieldset */
.mgb-youtube-fieldset {
    border: 2px solid rgba(147, 51, 234, 0.15);
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
}

.mgb-youtube-fieldset legend {
    font-weight: 700;
    color: #9333ea;
    padding: 0 8px;
    font-size: 14px;
}

.mgb-field-hint {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
    font-style: italic;
}

/* Submit Button */
.mgb-add-box button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #9333ea 0%, #db2777 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.3);
}

.mgb-add-box button[type="submit"]:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(147, 51, 234, 0.4);
}

.mgb-add-box button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* List Box */
.mgb-list-box {
    flex: 1;
    min-width: 500px;
    background: #fff;
    padding: 28px;
    border: 1px solid rgba(147, 51, 234, 0.1);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(147, 51, 234, 0.08);
}

.mgb-list-box h3 {
    margin-top: 0;
    color: #1d2327;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid rgba(147, 51, 234, 0.1);
    padding-bottom: 12px;
    margin-bottom: 20px;
}

/* Table Styles */
.wp-list-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
}

.wp-list-table th {
    background: linear-gradient(135deg, #faf5ff 0%, #f9fafb 100%);
    border-bottom: 2px solid rgba(147, 51, 234, 0.1);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
}

.wp-list-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f1;
    vertical-align: middle;
}

.wp-list-table tr:hover {
    background: rgba(147, 51, 234, 0.03);
}

/* Action Buttons */
.mgb-edit-btn {
    display: inline-block;
    background: #374151;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 6px;
    transition: all 0.2s ease;
}

.mgb-edit-btn:hover {
    background: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(55, 65, 81, 0.3);
}

.mgb-delete-genre-btn {
    background: transparent;
    color: #dc2626;
    border: 2px solid #dc2626;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mgb-delete-genre-btn:hover:not(:disabled) {
    background: #dc2626;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.mgb-delete-genre-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================================================
   MODAL STYLES
   ============================================================================ */
.mgb-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: mgb-modal-fade-in 0.3s ease;
}

@keyframes mgb-modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.mgb-modal-content {
    background-color: #fff;
    width: 90%;
    max-width: 540px;
    max-height: 90vh;
    margin: 5vh auto;
    border-radius: 20px;
    box-shadow: 0 20px 25px -5px rgba(147, 51, 234, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: mgb-modal-slide-in 0.3s ease;
}

@keyframes mgb-modal-slide-in {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.mgb-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(147, 51, 234, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #faf5ff 0%, #f9fafb 100%);
}

.mgb-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #9333ea 0%, #db2777 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mgb-close {
    color: #9ca3af;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.mgb-close:hover {
    color: #9333ea;
    transform: rotate(90deg);
}

#mgb-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.mgb-modern-form input,
.mgb-modern-form textarea,
.mgb-modern-form select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.mgb-modern-form input:focus,
.mgb-modern-form textarea:focus,
.mgb-modern-form select:focus {
    border-color: #9333ea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

.mgb-update-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.mgb-update-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.mgb-update-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================================================
   VISUAL EDITOR CANVAS
   ============================================================================ */
.mgb-canvas {
    width: 1000px;
    height: 700px;
    background: linear-gradient(135deg, #faf5ff 0%, #f3f4f6 100%);
    border: 2px solid rgba(147, 51, 234, 0.2);
    position: relative;
    margin-top: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(147, 51, 234, 0.1);
}

.mgb-editor-toolbar {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#mgb-save-layout {
    background: linear-gradient(135deg, #9333ea 0%, #db2777 100%);
    border: none;
    color: white;
    padding: 10px 20px;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(147,51,234,0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

#mgb-save-layout:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(147,51,234,0.4);
}

#mgb-save-layout:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#mgb-preview-layout {
    border: none;
    color: white;
    padding: 10px 20px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#mgb-preview-layout:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

/* ============================================================================
   ENHANCED RESPONSIVE DESIGN
   ============================================================================ */

/* Large Tablets and Small Laptops */
@media (max-width: 1200px) {
    .mgb-player-section {
        width: 450px;
        padding: 30px 25px;
    }
    
    .mgb-bubble-section {
        padding: 40px 30px;
    }
    
    .mgb-main-title {
        font-size: 44px;
    }
}

/* Tablets - Layout Switch */
@media (max-width: 1024px) {
    .mgb-layout {
        flex-direction: column;
    }
    
    .mgb-player-section {
        width: 100%;
        padding: 30px 25px;
        flex-direction: row;
        gap: 20px;
        border-left: none;
        border-top: 1px solid rgba(147, 51, 234, 0.1);
    }
    
    .mgb-music-player,
    .mgb-video-player {
        flex: 1;
        min-width: 0; /* Prevent flex overflow */
    }
    
    .mgb-bubble-section {
        padding: 30px 25px;
    }
    
    .mgb-main-title {
        font-size: 40px;
        margin-bottom: 30px;
    }
    
    .mgb-d3-canvas {
        min-height: 450px;
    }
    
    .mgb-counter {
        font-size: 18px;
        bottom: 30px;
        left: 30px;
    }
    
    /* Adjust time buttons for tablet */
    .mgb-time-controls {
        gap: 20px;
    }
    
    .mgb-time-btn {
        width: 44px;
        height: 44px;
    }
    
    .mgb-time-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* Large Phones */
@media (max-width: 768px) {
    .mgb-player-section {
        flex-direction: column;
        gap: 16px;
        padding: 20px 20px;
    }
    
    .mgb-bubble-section {
        padding: 20px 20px;
    }
    
    .mgb-main-title {
        font-size: 32px;
        margin-bottom: 20px;
    }
    
    .mgb-d3-canvas {
        min-height: 400px;
    }
    
    .mgb-counter {
        font-size: 16px;
        bottom: 20px;
        left: 20px;
        padding: 6px 12px;
    }
    
    /* Time buttons */
    .mgb-time-controls {
        gap: 16px;
        margin-top: 12px;
    }
    
    .mgb-time-btn {
        width: 42px;
        height: 42px;
    }
    
    .mgb-time-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .mgb-time-btn span {
        font-size: 7px;
    }
    
    /* Player text */
    .mgb-genre-name {
        font-size: 16px;
        letter-spacing: 1px;
        min-height: 24px;
    }
    
    .mgb-genre-detail {
        font-size: 12px;
        min-height: 36px;
        max-height: 48px;
    }
    
    .mgb-card2-title {
        font-size: 14px;
        min-height: 20px;
    }
    
    /* Admin section */
    .mgb-admin-panel {
        flex-direction: column;
    }
    
    .mgb-add-box,
    .mgb-list-box {
        width: 100%;
        min-width: auto;
    }
    
    .mgb-canvas {
        width: 100%;
        max-width: 100%;
        height: 500px;
    }
    
    .mgb-modal-content {
        width: 95%;
        max-width: 95%;
        margin: 3vh auto;
    }
    
    .mgb-image-upload-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mgb-upload-btn {
        width: 100% !important;
        text-align: center !important;
    }
    
    /* Loading message */
    .mgb-loading-message {
        font-size: 20px;
        white-space: normal;
        width: 80%;
        text-align: center;
    }
}

/* Medium Phones */
@media (max-width: 600px) {
    .mgb-main-title {
        font-size: 28px;
    }
    
    .mgb-bubble-section {
        padding: 15px 15px;
    }
    
    .mgb-player-section {
        padding: 15px 15px;
    }
    
    .mgb-d3-canvas {
        min-height: 350px;
    }
    
    .mgb-music-player,
    .mgb-video-player {
        padding: 15px;
    }
    
    .mgb-player-header {
        padding: 8px 5px 0;
        margin-bottom: 8px;
    }
    
    .mgb-genre-name {
        font-size: 15px;
        margin-bottom: 4px;
    }
    
    .mgb-genre-detail {
        font-size: 11px;
        min-height: 32px;
    }
    
    .mgb-card2-title {
        font-size: 13px;
    }
    
    .mgb-time-controls {
        gap: 12px;
    }
    
    .mgb-time-btn {
        width: 40px;
        height: 40px;
    }
    
    .mgb-time-btn svg {
        width: 15px;
        height: 15px;
    }
    
    .mgb-video-placeholder svg {
        width: 36px;
        height: 36px;
    }
    
    .mgb-placeholder-text {
        font-size: 12px;
        padding: 0 15px;
    }
    
    .mgb-counter {
        font-size: 14px;
        padding: 5px 10px;
    }
}

/* Small Phones */
@media (max-width: 480px) {
    .mgb-main-title {
        font-size: 24px;
        margin-bottom: 15px;
    }
    
    .mgb-bubble-section {
        padding: 12px 12px;
    }
    
    .mgb-player-section {
        padding: 12px 12px;
        gap: 12px;
    }
    
    .mgb-d3-canvas {
        min-height: 300px;
    }
    
    .mgb-counter {
        font-size: 12px;
        bottom: 12px;
        left: 12px;
        padding: 4px 8px;
    }
    
    .mgb-music-player,
    .mgb-video-player {
        padding: 12px;
        border-radius: 18px;
    }
    
    .mgb-genre-name {
        font-size: 14px;
        letter-spacing: 0.5px;
    }
    
    .mgb-genre-detail {
        font-size: 10px;
        min-height: 28px;
        max-height: 40px;
        line-height: 1.4;
    }
    
    .mgb-card2-title {
        font-size: 12px;
    }
    
    .mgb-time-controls {
        gap: 10px;
        margin-top: 8px;
    }
    
    .mgb-time-btn {
        width: 36px;
        height: 36px;
        border-width: 1.5px;
    }
    
    .mgb-time-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .mgb-time-btn span {
        font-size: 6px;
    }
    
    .mgb-video-placeholder svg {
        width: 32px;
        height: 32px;
        margin-bottom: 8px;
    }
    
    .mgb-placeholder-text {
        font-size: 11px;
    }
    
    /* Admin responsive */
    .mgb-canvas {
        height: 400px;
    }
    
    .mgb-add-box,
    .mgb-list-box {
        padding: 20px;
    }
    
    .mgb-add-box h3,
    .mgb-list-box h3 {
        font-size: 16px;
    }
    
    .wp-list-table {
        font-size: 12px;
    }
    
    .wp-list-table th,
    .wp-list-table td {
        padding: 8px 6px;
    }
    
    .mgb-edit-btn,
    .mgb-delete-genre-btn {
        padding: 4px 8px;
        font-size: 10px;
    }
}

/* Very Small Phones */
@media (max-width: 360px) {
    .mgb-main-title {
        font-size: 20px;
    }
    
    .mgb-bubble-section {
        padding: 10px 10px;
    }
    
    .mgb-d3-canvas {
        min-height: 250px;
    }
    
    .mgb-counter {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .mgb-player-section {
        padding: 10px 10px;
    }
    
    .mgb-time-controls {
        gap: 6px;
    }
    
    .mgb-time-btn {
        width: 32px;
        height: 32px;
    }
    
    .mgb-time-btn svg {
        width: 12px;
        height: 12px;
    }
    
    .mgb-time-btn span {
        font-size: 5px;
    }
    
    .mgb-genre-name {
        font-size: 12px;
    }
    
    .mgb-genre-detail {
        font-size: 9px;
        min-height: 24px;
    }
    
    .mgb-card2-title {
        font-size: 11px;
    }
    
    .mgb-video-placeholder svg {
        width: 24px;
        height: 24px;
    }
    
    .mgb-placeholder-text {
        font-size: 9px;
        padding: 0 8px;
    }
}

/* Landscape Mode for Phones */
@media (max-height: 600px) and (orientation: landscape) {
    .mgb-bubble-section {
        padding: 15px 20px;
    }
    
    .mgb-d3-canvas {
        min-height: 250px;
    }
    
    .mgb-main-title {
        font-size: 24px;
        margin-bottom: 10px;
    }
    
    .mgb-player-section {
        padding: 15px 20px;
    }
    
    .mgb-time-controls {
        margin-top: 8px;
    }
}

/* Print Styles */
@media print {
    .mgb-player-section,
    .mgb-time-controls,
    .mgb-counter {
        display: none;
    }
    
    .mgb-bubble-section {
        padding: 20px;
    }
    
    .mgb-main-title {
        -webkit-text-fill-color: #333;
        background: none;
        color: #333;
    }
    
    .mgb-d3-canvas svg {
        max-height: 500px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .mgb-time-btn {
        border: 2px solid #000;
    }
    
    .mgb-time-btn.active {
        background: #9333ea;
        color: #fff;
    }
    
    .mgb-genre-name,
    .mgb-card2-title,
    .mgb-main-title,
    .mgb-counter {
        -webkit-text-fill-color: currentColor;
        background: none;
        color: #9333ea;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .mgb-time-btn,
    .mgb-time-btn svg,
    .mgb-time-btn span,
    .mgb-sat-layer g,
    .mgb-close,
    .mgb-modal,
    .mgb-modal-content {
        animation: none !important;
        transition: none !important;
    }
}

/* Loading States */
.mgb-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #9333ea;
    font-size: 16px;
}

.mgb-loading::after {
    content: '';
    width: 24px;
    height: 24px;
    margin-left: 12px;
    border: 3px solid rgba(147, 51, 234, 0.3);
    border-top-color: #9333ea;
    border-radius: 50%;
    animation: mgb-spinner 0.8s linear infinite;
}

@keyframes mgb-spinner {
    to { transform: rotate(360deg); }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .mgb-time-btn {
        padding: 10px; /* Larger touch target */
    }
    
    .mgb-time-btn:hover {
        transform: none; /* Disable hover effects on touch devices */
    }
    
    .mgb-d3-canvas svg g:hover {
        transform: none;
    }
}