/**
 * Enhanced Buttons & Actions
 * Beautiful, modern, intuitive buttons for all interfaces
 */

/* ====================
   Action Buttons Group
   ==================== */
.mpd-action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* ====================
   Modern Button Base
   ==================== */
.mpd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.mpd-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.mpd-btn:hover::before {
    left: 100%;
}

.mpd-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mpd-btn:active {
    transform: translateY(0);
}

.mpd-btn-icon {
    font-size: 16px;
    line-height: 1;
}

/* ====================
   View Button (Primary)
   ==================== */
.mpd-btn-view {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.mpd-btn-view:hover {
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

/* ====================
   Export Buttons
   ==================== */
.mpd-btn-csv {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3);
}

.mpd-btn-csv:hover {
    box-shadow: 0 4px 16px rgba(72, 187, 120, 0.4);
}

.mpd-btn-excel {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.mpd-btn-excel:hover {
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

/* ====================
   Button Sizes
   ==================== */
.mpd-btn-sm {
    padding: 8px 14px;
    font-size: 12px;
}

.mpd-btn-lg {
    padding: 12px 20px;
    font-size: 14px;
}

/* ====================
   Button with Badge
   ==================== */
.mpd-btn-with-badge {
    position: relative;
}

.mpd-btn-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* ====================
   Icon-Only Buttons
   ==================== */
.mpd-btn-icon-only {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
}

.mpd-btn-icon-only .mpd-btn-icon {
    font-size: 18px;
}

/* ====================
   Button Tooltip
   ==================== */
.mpd-btn[data-tooltip] {
    position: relative;
}

.mpd-btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 6px 12px;
    background: #1a202c;
    color: white;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 1000;
}

.mpd-btn[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* ====================
   Loading State
   ==================== */
.mpd-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.mpd-btn.loading .mpd-btn-icon {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ====================
   Disabled State
   ==================== */
.mpd-btn:disabled,
.mpd-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ====================
   Button Group
   ==================== */
.mpd-btn-group {
    display: inline-flex;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mpd-btn-group .mpd-btn {
    border-radius: 0;
    margin: 0;
}

.mpd-btn-group .mpd-btn:first-child {
    border-radius: 8px 0 0 8px;
}

.mpd-btn-group .mpd-btn:last-child {
    border-radius: 0 8px 8px 0;
}

.mpd-btn-group .mpd-btn:not(:last-child) {
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

/* ====================
   Responsive Design
   ==================== */
@media (max-width: 768px) {
    .mpd-action-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mpd-btn {
        width: 100%;
        justify-content: center;
    }
    
    .mpd-btn-group {
        flex-direction: column;
    }
    
    .mpd-btn-group .mpd-btn {
        border-radius: 0;
        border-right: none;
    }
    
    .mpd-btn-group .mpd-btn:not(:last-child) {
        border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    }
    
    .mpd-btn-group .mpd-btn:first-child {
        border-radius: 8px 8px 0 0;
    }
    
    .mpd-btn-group .mpd-btn:last-child {
        border-radius: 0 0 8px 8px;
    }
}

/* ====================
   Admin Table Button Adjustments
   ==================== */
.wp-list-table .mpd-action-buttons {
    justify-content: flex-start;
}

.wp-list-table .mpd-btn {
    font-size: 12px;
    padding: 6px 12px;
}

/* ====================
   Alternative Button Styles
   ==================== */
.mpd-btn-outline {
    background: white;
    border: 2px solid currentColor;
    box-shadow: none;
}

.mpd-btn-outline.mpd-btn-view {
    color: #667eea;
    background: white;
}

.mpd-btn-outline.mpd-btn-view:hover {
    background: #667eea;
    color: white;
}

.mpd-btn-outline.mpd-btn-csv {
    color: #48bb78;
    background: white;
}

.mpd-btn-outline.mpd-btn-csv:hover {
    background: #48bb78;
    color: white;
}

.mpd-btn-outline.mpd-btn-excel {
    color: #10b981;
    background: white;
}

.mpd-btn-outline.mpd-btn-excel:hover {
    background: #10b981;
    color: white;
}

/* ====================
   Soft Button Variant
   ==================== */
.mpd-btn-soft {
    box-shadow: none;
}

.mpd-btn-soft.mpd-btn-view {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.mpd-btn-soft.mpd-btn-view:hover {
    background: rgba(102, 126, 234, 0.2);
}

.mpd-btn-soft.mpd-btn-csv {
    background: rgba(72, 187, 120, 0.1);
    color: #48bb78;
}

.mpd-btn-soft.mpd-btn-csv:hover {
    background: rgba(72, 187, 120, 0.2);
}

.mpd-btn-soft.mpd-btn-excel {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.mpd-btn-soft.mpd-btn-excel:hover {
    background: rgba(16, 185, 129, 0.2);
}
