/* ===========================================
   C4-AI - Menu Buttons Section - Modern Design
   =========================================== */

/* Page Header */
.menu-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 16px;
    color: white;
}

.menu-page-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-page-header .header-icon {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-page-header .header-icon svg {
    width: 24px;
    height: 24px;
    stroke: white;
    fill: none;
    stroke-width: 2;
}

.menu-page-header p {
    margin: 4px 0 0;
    opacity: 0.9;
    font-size: 14px;
}

/* Add Button */
.btn-add-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: white;
    color: #059669;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

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

.btn-add-menu svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* Info Card */
.menu-info-banner {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.05));
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.menu-info-banner svg {
    width: 24px;
    height: 24px;
    stroke: #10b981;
    fill: none;
    stroke-width: 2;
    flex-shrink: 0;
}

.menu-info-banner p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Stats Row */
.menu-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.menu-stat {
    flex: 1;
    min-width: 140px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.menu-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-stat-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.menu-stat-icon.green { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.menu-stat-icon.blue { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.menu-stat-icon.orange { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

.menu-stat-info h4 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.menu-stat-info p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 2px 0 0;
}

/* Buttons Grid */
.menu-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Menu Button Card */
.menu-btn-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.menu-btn-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #10b981, #059669);
    opacity: 0;
    transition: opacity 0.3s;
}

.menu-btn-card:hover {
    border-color: #10b981;
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.15);
    transform: translateY(-4px);
}

.menu-btn-card:hover::before {
    opacity: 1;
}

/* Card Header */
.mb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(to bottom, var(--content-bg), transparent);
}

.mb-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.mb-text::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
}

.mb-type {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    text-transform: uppercase;
}

.mb-type.text { color: #10b981; background: rgba(16, 185, 129, 0.1); }
.mb-type.photo { color: #f59e0b; background: rgba(245, 158, 11, 0.1); }
.mb-type.voice { color: #ec4899; background: rgba(236, 72, 153, 0.1); }
.mb-type.video { color: #3b82f6; background: rgba(59, 130, 246, 0.1); }
.mb-type.document { color: #8b5cf6; background: rgba(139, 92, 246, 0.1); }
.mb-type.submenu { color: #6366f1; background: rgba(99, 102, 241, 0.1); }

/* Card Body */
.mb-body {
    padding: 14px 20px;
    min-height: 60px;
}

.mb-body p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mb-body em {
    color: var(--text-muted);
    font-style: normal;
}

/* Card Footer */
.mb-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: var(--content-bg);
    border-top: 1px solid var(--border-color);
}

.mb-layout {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--card-bg);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.mb-layout svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* Card Actions */
.mb-actions {
    display: flex;
    gap: 8px;
}

.mb-actions .btn {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-family);
}

.mb-actions .btn-edit {
    background: var(--card-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.mb-actions .btn-edit:hover {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.mb-actions .btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.mb-actions .btn-danger:hover {
    background: var(--danger);
    color: white;
}

/* Children Indicator */
.mb-children {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
    margin-top: 10px;
}

.mb-children svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* Empty State */
.menu-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 40px;
    background: var(--card-bg);
    border: 2px dashed var(--border-color);
    border-radius: 20px;
}

.menu-empty svg {
    width: 80px;
    height: 80px;
    stroke: var(--border-color);
    fill: none;
    stroke-width: 1;
    margin-bottom: 20px;
}

.menu-empty h3 {
    font-size: 20px;
    color: var(--text-dark);
    margin: 0 0 8px;
}

.menu-empty p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 24px;
}

/* Loading State */
.menu-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
}

.menu-loading .loader {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: #10b981;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

.menu-loading p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Tree View (for hierarchical buttons) */
.menu-tree {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.menu-tree-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.menu-tree-item.has-children {
    border-right: 3px solid #6366f1;
}

.menu-tree-children {
    padding: 12px 12px 12px 32px;
    background: var(--content-bg);
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .menu-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .menu-buttons-grid {
        grid-template-columns: 1fr;
    }
    
    .mb-actions {
        flex-wrap: wrap;
    }
    
    .menu-stats {
        flex-direction: column;
    }
}
