/**
 * QuickBar - Bottom Navigation Bar System
 * Scoped CSS with qb- prefix to prevent conflicts
 * Version: 1.0.0
 */

/* ============================================
   CSS Custom Properties (Scoped)
   ============================================ */
.qb-wrapper {
    --qb-primary: #3b82f6;
    --qb-secondary: #64748b;
    --qb-success: #10b981;
    --qb-warning: #f59e0b;
    --qb-danger: #ef4444;
    --qb-light: #f8fafc;
    --qb-dark: #1e293b;
    --qb-white: #ffffff;
    --qb-border: #e2e8f0;
    --qb-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    --qb-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --qb-font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================
   Reset & Base Styles
   ============================================ */
.qb-wrapper,
.qb-wrapper *,
.qb-wrapper *::before,
.qb-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.qb-wrapper {
    font-family: var(--qb-font-family);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   QuickBar Container
   ============================================ */
.qb-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--qb-white);
    box-shadow: var(--qb-shadow);
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    transition: var(--qb-transition);
    overflow: visible;
}

.qb-bar.qb-hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

/* Safe area for iOS devices */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .qb-bar {
        padding-bottom: calc(env(safe-area-inset-bottom));
    }
}

/* ============================================
   QuickBar Items
   ============================================ */
.qb-items {
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    gap: 10px;
    overflow: visible;
}

.qb-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    min-width: 60px;
    border-radius: 5px;
    transition: var(--qb-transition);
    cursor: pointer;
    position: relative;
    flex: 1;
    max-width: 100px;
    gap: 6px;
    overflow: visible;
}

.qb-item:hover {
    transform: translateY(-2px);
}

.qb-item:active {
    transform: translateY(0) scale(0.98);
}

.qb-item.qb-item-active::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--qb-primary);
    border-radius: 0 0 3px 3px;
}

/* ============================================
   Icon Wrapper
   ============================================ */
.qb-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--qb-transition);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.qb-icon-wrapper.qb-shape-circle {
    border-radius: 50%;
}

.qb-icon-wrapper.qb-shape-square {
    border-radius: 6px;
}

.qb-icon-wrapper.qb-shape-rounded {
    border-radius: 10px;
}

.qb-item:hover .qb-icon-wrapper {
    transform: scale(1.1);
}

/* ============================================
   Icon Styles
   ============================================ */
.qb-icon {
    line-height: 1;
    transition: var(--qb-transition);
}

/* SVG Icon specific styles to prevent background issues */
.qb-svg-icon {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    flex-shrink: 0;
}

/* Ensure icon wrapper properly contains SVG */
.qb-icon-wrapper img.qb-svg-icon {
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
}

/* ============================================
   Label Styles
   ============================================ */
.qb-label {
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    transition: var(--qb-transition);
}

/* ============================================
   Shortcode Container
   ============================================ */
.qb-shortcode {
    display: flex;
    align-items: center;
    justify-content: center;
}

.qb-shortcode > * {
    max-width: 100%;
}

/* ============================================
   Responsive Styles
   ============================================ */
@media (min-width: 768px) {
    .qb-bar {
        max-width: 500px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 10px 10px 0 0;
    }
    
    .qb-bar.qb-hidden {
        transform: translateX(-50%) translateY(100%);
    }
    
}

/* Hide on desktop when disabled */
.qb-bar.qb-desktop-hidden {
    display: none;
}

@media (min-width: 768px) {
    .qb-bar.qb-desktop-hidden {
        display: none !important;
    }
}

/* Hide on mobile when disabled */
@media (max-width: 767px) {
    .qb-bar.qb-mobile-hidden {
        display: none !important;
    }
}

/* ============================================
   Admin Panel Styles
   ============================================ */
.qb-admin-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    font-family: var(--qb-font-family);
}

.qb-admin-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    min-height: 100vh;
}

@media (max-width: 1200px) {
    .qb-admin-container {
        grid-template-columns: 1fr;
    }
}

/* Admin Header */
.qb-admin-header {
    background: linear-gradient(135deg, var(--qb-primary) 0%, #2563eb 100%);
    color: var(--qb-white);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
}

.qb-admin-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.qb-admin-header h1 i {
    font-size: 28px;
}

.qb-admin-version {
    font-size: 12px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
}

/* Admin Main Content */
.qb-admin-main {
    padding: 24px;
    overflow-y: auto;
    max-height: 100vh;
}

/* Admin Sections */
.qb-admin-section {
    background: var(--qb-white);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
    overflow: hidden;
}

.qb-admin-section-header {
    background: var(--qb-light);
    padding: 16px 20px;
    border-bottom: 1px solid var(--qb-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.qb-admin-section-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--qb-dark);
    margin: 0;
}

.qb-admin-section-header i {
    color: var(--qb-primary);
    font-size: 18px;
}

.qb-admin-section-body {
    padding: 20px;
}

/* Form Elements */
.qb-form-group {
    margin-bottom: 20px;
}

.qb-form-group:last-child {
    margin-bottom: 0;
}

.qb-form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--qb-secondary);
    margin-bottom: 8px;
}

.qb-form-input,
.qb-form-select {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--qb-border);
    border-radius: 8px;
    background: var(--qb-white);
    color: var(--qb-dark);
    transition: var(--qb-transition);
    font-family: inherit;
}

.qb-form-input:focus,
.qb-form-select:focus {
    outline: none;
    border-color: var(--qb-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.qb-form-input::placeholder {
    color: #94a3b8;
}

/* Color Picker */
.qb-color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qb-color-picker {
    width: 50px;
    height: 38px;
    padding: 2px;
    border: 1px solid var(--qb-border);
    border-radius: 8px;
    cursor: pointer;
    background: var(--qb-white);
}

.qb-color-picker::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.qb-color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.qb-color-value {
    flex: 1;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 13px;
}

/* Toggle Switch */
.qb-toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.qb-toggle {
    position: relative;
    width: 48px;
    height: 26px;
    cursor: pointer;
}

.qb-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.qb-toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cbd5e1;
    border-radius: 26px;
    transition: var(--qb-transition);
}

.qb-toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--qb-white);
    border-radius: 50%;
    transition: var(--qb-transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.qb-toggle input:checked + .qb-toggle-slider {
    background: var(--qb-primary);
}

.qb-toggle input:checked + .qb-toggle-slider::before {
    transform: translateX(22px);
}

/* Range Slider */
.qb-range-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qb-range {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    background: var(--qb-border);
    border-radius: 3px;
    outline: none;
}

.qb-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--qb-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
    transition: var(--qb-transition);
}

.qb-range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.qb-range-value {
    min-width: 45px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--qb-dark);
    background: var(--qb-light);
    padding: 4px 8px;
    border-radius: 6px;
}

/* Buttons */
.qb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--qb-transition);
    font-family: inherit;
}

.qb-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.qb-btn-primary {
    background: var(--qb-primary);
    color: var(--qb-white);
}

.qb-btn-primary:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.qb-btn-secondary {
    background: var(--qb-light);
    color: var(--qb-dark);
    border: 1px solid var(--qb-border);
}

.qb-btn-secondary:hover:not(:disabled) {
    background: #e2e8f0;
}

.qb-btn-success {
    background: var(--qb-success);
    color: var(--qb-white);
}

.qb-btn-success:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.qb-btn-danger {
    background: var(--qb-danger);
    color: var(--qb-white);
}

.qb-btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.qb-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.qb-btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.qb-btn-block {
    width: 100%;
}

/* Items List */
.qb-items-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.qb-item-card {
    background: var(--qb-white);
    border: 1px solid var(--qb-border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    transition: var(--qb-transition);
    cursor: grab;
}

.qb-item-card:hover {
    border-color: var(--qb-primary);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.qb-item-card.qb-dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.qb-item-card.qb-item-inactive {
    opacity: 0.6;
    background: #f8fafc;
}

.qb-item-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.qb-item-card-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qb-item-card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 18px;
}

.qb-item-card-details h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--qb-dark);
    margin: 0 0 2px 0;
}

.qb-item-card-details span {
    font-size: 12px;
    color: var(--qb-secondary);
}

.qb-item-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qb-item-card-actions .qb-btn {
    padding: 6px 10px;
}

.qb-item-drag-handle {
    cursor: grab;
    color: var(--qb-secondary);
    padding: 4px;
}

.qb-item-drag-handle:hover {
    color: var(--qb-dark);
}

/* Add Item Button */
.qb-add-item-btn {
    width: 100%;
    padding: 16px;
    border: 2px dashed var(--qb-border);
    border-radius: 10px;
    background: transparent;
    color: var(--qb-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--qb-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.qb-add-item-btn:hover {
    border-color: var(--qb-primary);
    color: var(--qb-primary);
    background: rgba(59, 130, 246, 0.05);
}

.qb-add-item-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Preview Panel */
.qb-preview-panel {
    background: #1e293b;
    padding: 24px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.qb-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.qb-preview-header h3 {
    color: var(--qb-white);
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.qb-preview-toggle {
    display: flex;
    background: #334155;
    border-radius: 8px;
    padding: 4px;
}

.qb-preview-toggle-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    background: transparent;
    color: #94a3b8;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--qb-transition);
}

.qb-preview-toggle-btn.qb-active {
    background: var(--qb-primary);
    color: var(--qb-white);
}

.qb-preview-device {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qb-preview-mobile {
    width: 320px;
    height: 568px;
    background: var(--qb-white);
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    border: 8px solid #374151;
}

.qb-preview-desktop {
    width: 100%;
    max-width: 600px;
    height: 400px;
    background: var(--qb-white);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    border: 4px solid #374151;
}

.qb-preview-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 24px;
    background: #374151;
    border-radius: 0 0 16px 16px;
}

.qb-preview-content {
    height: 100%;
    background: linear-gradient(180deg, #f0f4f8 0%, #e2e8f0 100%);
    padding: 40px 16px 100px 16px;
    overflow-y: auto;
}

.qb-preview-placeholder {
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    padding: 20px;
}

.qb-preview-placeholder i {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}

.qb-preview-bar-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

/* Modal */
.qb-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: var(--qb-transition);
}

.qb-modal-overlay.qb-active {
    opacity: 1;
    visibility: visible;
}

.qb-modal {
    background: var(--qb-white);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    transform: translateY(20px);
    transition: var(--qb-transition);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.qb-modal-overlay.qb-active .qb-modal {
    transform: translateY(0);
}

.qb-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--qb-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.qb-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--qb-dark);
    margin: 0;
}

.qb-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--qb-light);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--qb-secondary);
    transition: var(--qb-transition);
}

.qb-modal-close:hover {
    background: var(--qb-danger);
    color: var(--qb-white);
}

.qb-modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.qb-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--qb-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Icon Picker */
.qb-icon-picker-search {
    margin-bottom: 16px;
}

.qb-icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

.qb-icon-picker-item {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--qb-border);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--qb-transition);
    background: var(--qb-white);
    font-size: 18px;
    color: var(--qb-secondary);
}

.qb-icon-picker-item:hover {
    border-color: var(--qb-primary);
    color: var(--qb-primary);
    background: rgba(59, 130, 246, 0.05);
}

.qb-icon-picker-item.qb-selected {
    border-color: var(--qb-primary);
    background: var(--qb-primary);
    color: var(--qb-white);
}

/* Admin Icon Picker */
.icon-picker-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
}

.icon-picker-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: #fff;
    border: 1px solid #e2e8f0;
    width: calc(12.5% - 8px); /* 8 items per row minus gap */
    box-sizing: border-box;
}

.icon-picker-item:hover {
    background: #eff6ff;
    border-color: #3b82f6;
}

.icon-picker-item.selected {
    background: #3b82f6;
    border-color: #3b82f6;
}

/* Icons keep their original colors when selected */
.icon-picker-item.selected i {
    color: #475569;
}

.icon-picker-item.selected img {
    filter: none;
}

.icon-picker-item i {
    font-size: 24px;
    color: #475569;
    margin-bottom: 4px;
}

.icon-picker-item img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    margin-bottom: 4px;
}

.icon-picker-item span {
    font-size: 10px;
    color: #64748b;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

/* Selected label keeps original color */
.icon-picker-item.selected span {
    color: #64748b;
}

/* Upload Button for SVG Icons */
.icon-upload-btn {
    background: #f8fafc;
    border: 2px dashed #94a3b8;
    color: #64748b;
}

.icon-upload-btn:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    border-color: #6366f1;
    transform: scale(1.05);
}

.icon-upload-btn:hover i,
.icon-upload-btn:hover span {
    color: #fff;
}

.icon-upload-btn i {
    color: #64748b;
    font-size: 28px;
    margin-bottom: 4px;
}

.icon-upload-btn span {
    color: #64748b;
    font-weight: 600;
}

/* SVG Upload Modal */
#svg-upload-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100002;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#svg-upload-modal.qb-active {
    opacity: 1;
    visibility: visible;
}

#svg-upload-modal .qb-modal {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.3s ease;
    position: relative;
}

#svg-upload-modal.qb-active .qb-modal {
    transform: scale(1) translateY(0);
}

.qb-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.qb-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.qb-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.qb-modal-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.qb-modal-body {
    padding: 24px;
}

.qb-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0 0 16px 16px;
}

.qb-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.qb-btn-primary {
    background: #3b82f6;
    color: #fff;
}

.qb-btn-primary:hover {
    background: #2563eb;
}

.qb-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.qb-btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.qb-btn-secondary:hover {
    background: #e2e8f0;
}

/* Tabs */
.qb-tabs {
    display: flex;
    border-bottom: 1px solid var(--qb-border);
    margin-bottom: 20px;
}

.qb-tab {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--qb-secondary);
    border: none;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: var(--qb-transition);
}

.qb-tab:hover {
    color: var(--qb-dark);
}

.qb-tab.qb-active {
    color: var(--qb-primary);
}

.qb-tab.qb-active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--qb-primary);
}

.qb-tab-content {
    display: none;
}

.qb-tab-content.qb-active {
    display: block;
}

/* Alerts */
.qb-alert {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.qb-alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.qb-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.qb-alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.qb-alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Save Button Container */
.qb-save-container {
    position: sticky;
    bottom: 0;
    background: var(--qb-white);
    padding: 16px 20px;
    border-top: 1px solid var(--qb-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin: 0 -20px -20px -20px;
}

/* Loading Spinner */
.qb-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--qb-white);
    border-radius: 50%;
    animation: qb-spin 0.8s linear infinite;
}

@keyframes qb-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toast Notifications */
.qb-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100001;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.qb-toast {
    background: var(--qb-dark);
    color: var(--qb-white);
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateX(120%);
    transition: var(--qb-transition);
}

.qb-toast.qb-show {
    transform: translateX(0);
}

.qb-toast-success {
    background: var(--qb-success);
}

.qb-toast-error {
    background: var(--qb-danger);
}

/* Form Row */
.qb-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .qb-form-row {
        grid-template-columns: 1fr;
    }
}

/* Shape Selector */
.qb-shape-selector {
    display: flex;
    gap: 10px;
}

.qb-shape-option {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--qb-border);
    border-radius: 8px;
    background: var(--qb-white);
    cursor: pointer;
    text-align: center;
    transition: var(--qb-transition);
}

.qb-shape-option:hover {
    border-color: var(--qb-primary);
}

.qb-shape-option.qb-selected {
    border-color: var(--qb-primary);
    background: rgba(59, 130, 246, 0.05);
}

.qb-shape-option i {
    font-size: 24px;
    margin-bottom: 6px;
    display: block;
}

.qb-shape-option span {
    font-size: 11px;
    color: var(--qb-secondary);
}

/* No Icon - Label with Border */
.qb-item.qb-item-no-icon {
    justify-content: center;
}

.qb-label-no-icon {
    white-space: nowrap;
    width: auto;
    max-width: none;
}

/* Utility Classes */
.qb-hidden {
    display: none !important;
}

.qb-text-center {
    text-align: center;
}

.qb-text-muted {
    color: var(--qb-secondary);
}

.qb-mb-0 {
    margin-bottom: 0 !important;
}

.qb-mt-2 {
    margin-top: 8px;
}

.qb-mt-4 {
    margin-top: 16px;
}

/* ============================================
   Icon Animations
   ============================================ */

/* Shine Animation */
@keyframes qb-shine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(200%) rotate(45deg);
    }
}

.qb-icon-wrapper.qb-animate-shine {
    position: relative;
    overflow: hidden;
}

.qb-icon-wrapper.qb-animate-shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 50%;
    height: 200%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: qb-shine var(--qb-animation-duration, 3s) ease-in-out infinite;
}

/* Bounce Animation */
@keyframes qb-bounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    25% {
        transform: translateY(-8px) scale(1.02);
    }
    50% {
        transform: translateY(0) scale(1);
    }
}

.qb-icon-wrapper.qb-animate-bounce {
    animation: qb-bounce var(--qb-animation-duration, 2s) ease-in-out infinite;
}

/* Shake Animation */
@keyframes qb-shake {
    0%, 100% {
        transform: translateX(0) rotate(0deg);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-3px) rotate(-2deg);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(3px) rotate(2deg);
    }
}

.qb-icon-wrapper.qb-animate-shake {
    animation: qb-shake var(--qb-animation-duration, 1s) ease-in-out infinite;
}

/* Animation pause on hover (optional enhancement) */
.qb-item:hover .qb-icon-wrapper[class*="qb-animate-"] {
    animation-play-state: paused;
}

/* Prevent animation conflicts with hover scale */
.qb-icon-wrapper[class*="qb-animate-"] {
    transform-origin: center center;
}

/* ============================================
   Heartbeat Animation
   ============================================ */

.qb-icon-wrapper.qb-animate-heartbeat {
    animation: qb-heartbeat var(--qb-animation-duration, 1.5s) ease-in-out infinite;
}

@keyframes qb-heartbeat {
    0% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.15);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.15);
    }
    70% {
        transform: scale(1);
    }
}

/* ============================================
   Submenu Panel Styles (Slide in from right, vertical)
   ============================================ */

/* Submenu Panel - Slide from right side, vertically centered */
.qb-submenu-panel {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translate(100%, -50%);
    width: auto;
    max-height: 70vh;
    background-color: var(--qb-white, #ffffff);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.12);
    z-index: 9998;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border-radius: 12px 0 0 12px;
}

.qb-submenu-panel.qb-submenu-open {
    transform: translate(0, -50%);
}

/* Submenu Items Container - Vertical stack */
.qb-submenu-items {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 6px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 100%;
    scrollbar-width: none; /* Firefox */
}

.qb-submenu-items::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

/* Submenu Item - Icon on top, label below */
.qb-submenu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--qb-dark, #1e293b);
    padding: 8px 6px;
    width: 100%;
    transition: background-color 0.2s ease, transform 0.1s ease;
    border-radius: 10px;
}

.qb-submenu-item:hover {
    background-color: var(--qb-light, #f8fafc);
    transform: scale(1.03);
}

.qb-submenu-item:active {
    transform: scale(0.98);
}

/* Submenu Icon Wrapper */
.qb-submenu-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 8px;
    margin-bottom: 4px;
}

.qb-submenu-icon-wrapper img,
.qb-submenu-icon-wrapper svg {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
    max-width: 100%;
    max-height: 100%;
    flex-shrink: 0;
}

/* Submenu Icon (FontAwesome) */
.qb-submenu-icon {
    font-size: 16px;
}

/* Submenu Label - Below icon */
.qb-submenu-label {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.2;
}

/* Submenu Arrow on Parent Items in main bar */
.qb-submenu-arrow {
    margin-left: 4px;
    font-size: 12px;
    color: var(--qb-secondary, #64748b);
    transition: transform 0.2s ease;
}

.qb-item:hover .qb-submenu-arrow {
    transform: translateX(2px);
}

/* Active parent item (when submenu is open) */
.qb-item.qb-parent-active {
    background-color: var(--qb-light, #f8fafc);
}

/* Desktop adjustments */
@media (min-width: 768px) {
    .qb-submenu-panel {
        border-radius: 14px 0 0 14px;
    }
    
    .qb-submenu-items {
        gap: 6px;
        padding: 16px 12px;
    }
    
    .qb-submenu-item {
        padding: 14px 10px 10px 10px;
    }
    
    .qb-submenu-icon-wrapper {
        width: 40px;
        height: 40px;
        margin-bottom: 8px;
    }
    
    .qb-submenu-icon-wrapper img,
    .qb-submenu-icon-wrapper svg {
        width: 26px;
        height: 26px;
    }
    
    .qb-submenu-icon {
        font-size: 20px;
    }
    
    .qb-submenu-label {
        font-size: 12px;
    }
}

/* ============================================
   Delayed Tooltip
   ============================================ */
.qb-delayed-tooltip {
    position: absolute;
    bottom: calc(100% + 20px);
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    transform: translateY(10px);
    background-color: #ffffff;
    color: #1e293b;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    white-space: normal;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
    z-index: 100001;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

.qb-delayed-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: var(--arrow-position, 50%);
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #ffffff;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

.qb-delayed-tooltip.qb-tooltip-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0s;
}

.qb-delayed-tooltip.qb-tooltip-hiding {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .qb-delayed-tooltip {
        padding: 8px 12px;
        font-size: 11px;
        line-height: 1.3;
        bottom: calc(100% + 15px);
    }
    
    .qb-delayed-tooltip::after {
        border-width: 6px;
    }
}

/* Desktop adjustments */
@media (min-width: 768px) {
    .qb-delayed-tooltip {
        bottom: calc(100% + 25px);
        padding: 12px 18px;
        font-size: 13px;
        border-radius: 12px;
    }
    
    .qb-delayed-tooltip::after {
        border-width: 9px;
    }
}
