/* ============================================================
   MMT MODERN CSS - Override untuk semua halaman MMT
   Version: 1.0
   ============================================================ */

/* ============================================================
   1. CSS VARIABLES (untuk konsistensi & gampang ganti tema)
   ============================================================ */
:root {
    /* Primary colors */
    --mmt-primary-1: #6366f1;
    --mmt-primary-2: #8b5cf6;
    --mmt-primary-3: #ec4899;
    --mmt-primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    
    /* Success (WA button, dll) */
    --mmt-success-1: #10b981;
    --mmt-success-2: #059669;
    --mmt-success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    
    /* Danger */
    --mmt-danger-1: #ef4444;
    --mmt-danger-2: #dc2626;
    --mmt-danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    
    /* Neutral */
    --mmt-bg-card: rgba(255, 255, 255, 0.75);
    --mmt-bg-solid: #ffffff;
    --mmt-bg-subtle: #f8f9ff;
    --mmt-border: rgba(0, 0, 0, 0.06);
    --mmt-border-strong: rgba(0, 0, 0, 0.1);
    
    /* Text */
    --mmt-text-primary: #111827;
    --mmt-text-secondary: #6b7280;
    --mmt-text-tertiary: #9ca3af;
    
    /* Radius */
    --mmt-radius-sm: 10px;
    --mmt-radius-md: 16px;
    --mmt-radius-lg: 22px;
    --mmt-radius-xl: 28px;
    
    /* Shadow */
    --mmt-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.04);
    --mmt-shadow-md: 0 1px 3px rgba(0, 0, 0, 0.05), 0 8px 24px rgba(0, 0, 0, 0.06);
    --mmt-shadow-lg: 0 1px 3px rgba(0, 0, 0, 0.05), 0 20px 60px rgba(0, 0, 0, 0.08);
    --mmt-shadow-primary: 0 8px 24px rgba(99, 102, 241, 0.25), 0 4px 12px rgba(99, 102, 241, 0.15);
    --mmt-shadow-primary-hover: 0 12px 32px rgba(99, 102, 241, 0.35), 0 6px 16px rgba(99, 102, 241, 0.2);
    
    /* Transition */
    --mmt-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --mmt-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dark mode override */
@media (prefers-color-scheme: dark) {
    :root {
        --mmt-bg-card: rgba(30, 30, 42, 0.75);
        --mmt-bg-solid: #1e1e2a;
        --mmt-bg-subtle: rgba(50, 50, 70, 0.4);
        --mmt-border: rgba(255, 255, 255, 0.08);
        --mmt-border-strong: rgba(255, 255, 255, 0.12);
        --mmt-text-primary: #f3f4f6;
        --mmt-text-secondary: #9ca3af;
        --mmt-text-tertiary: #6b7280;
    }
}

/* ============================================================
   2. GLOBAL RESET untuk container MMT
   ============================================================ */
.mmt-container,
.mmt-cart-page,
.mmt-mkt-page,
.mmt-hist-page {
    background: var(--mmt-bg-card) !important;
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-radius: var(--mmt-radius-xl) !important;
    box-shadow: var(--mmt-shadow-lg) !important;
    border: 1px solid var(--mmt-border) !important;
    padding: 32px 40px !important;
    transition: all 0.3s var(--mmt-ease);
}

/* Header teks di dalam container */
.mmt-container h2,
.mmt-cart-header h2,
.mmt-mkt-header h2,
.mmt-hist-header h2 {
    font-weight: 800 !important;
    font-size: 24px !important;
    letter-spacing: -0.02em;
    color: var(--mmt-text-primary) !important;
}

.mmt-container h3,
.mmt-cart-page h3,
.mmt-mkt-page h3,
.mmt-hist-page h3 {
    font-weight: 700 !important;
    color: var(--mmt-text-primary) !important;
}

/* ============================================================
   3. BUTTONS - Modern dengan micro-interaction
   ============================================================ */
.mmt-btn,
.mmt-btn-action,
.mmt-cart-badge,
.mmt-hist-page .mmt-btn-apply,
.mmt-cart-page .mmt-btn,
.mmt-mkt-page .mmt-btn {
    background: var(--mmt-primary-gradient) !important;
    background-size: 200% 200% !important;
    border-radius: var(--mmt-radius-md) !important;
    padding: 14px 28px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    letter-spacing: -0.01em;
    box-shadow: var(--mmt-shadow-primary) !important;
    transition: all 0.3s var(--mmt-ease) !important;
    border: none !important;
    color: #fff !important;
    text-decoration: none !important;
    position: relative;
    overflow: hidden;
}

.mmt-btn:hover,
.mmt-btn-action:hover,
.mmt-cart-badge:hover {
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: var(--mmt-shadow-primary-hover) !important;
    background-position: 100% 0 !important;
    color: #fff !important;
}

.mmt-btn:active,
.mmt-btn-action:active {
    transform: translateY(-1px) scale(0.99) !important;
}

/* Button success (Tambah Marketing, WA) */
.mmt-btn-success,
.mmt-mkt-badge,
.mmt-success-btn-wa {
    background: var(--mmt-success-gradient) !important;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.25) !important;
}

.mmt-btn-success:hover,
.mmt-mkt-badge:hover,
.mmt-success-btn-wa:hover {
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.35) !important;
}

/* Button secondary (Kembali, Cancel) */
.mmt-btn-secondary {
    background: var(--mmt-bg-subtle) !important;
    color: var(--mmt-text-primary) !important;
    box-shadow: none !important;
    border: 1px solid var(--mmt-border-strong) !important;
}

.mmt-btn-secondary:hover {
    background: rgba(99, 102, 241, 0.1) !important;
    border-color: var(--mmt-primary-1) !important;
    color: var(--mmt-primary-1) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15) !important;
}

/* Button danger (Hapus, Arsip) */
.mmt-btn-danger,
.mmt-modal-btn.confirm {
    background: var(--mmt-danger-gradient) !important;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.25) !important;
}

.mmt-btn-danger:hover {
    box-shadow: 0 12px 32px rgba(239, 68, 68, 0.35) !important;
}

/* ============================================================
   4. FORM INPUTS - Modern dengan focus effect
   ============================================================ */
.mmt-field input,
.mmt-field select,
.mmt-modal input,
.mmt-modal select,
.mmt-filter-group select,
.mmt-filter-group input,
.mmt-qty-input,
#mmt-edit-nama,
#mmt-edit-nomor1,
#mmt-edit-nomor2,
#mmt-add-nama,
#mmt-add-nomor1,
#mmt-add-nomor2 {
    background: var(--mmt-bg-solid) !important;
    border: 2px solid var(--mmt-border) !important;
    border-radius: var(--mmt-radius-sm) !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    font-weight: 500;
    color: var(--mmt-text-primary) !important;
    transition: all 0.25s var(--mmt-ease) !important;
}

.mmt-field input:focus,
.mmt-field select:focus,
.mmt-modal input:focus,
.mmt-filter-group select:focus,
.mmt-filter-group input:focus {
    outline: none !important;
    border-color: var(--mmt-primary-1) !important;
    box-shadow: 
        0 0 0 4px rgba(99, 102, 241, 0.1),
        0 4px 12px rgba(99, 102, 241, 0.08) !important;
    transform: translateY(-1px);
}

.mmt-field label,
.mmt-filter-group label,
.mmt-modal label {
    font-weight: 700 !important;
    font-size: 12px !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--mmt-text-secondary) !important;
    margin-bottom: 6px !important;
}

/* ============================================================
   5. CARD & LIST - Modern dengan hover effect
   ============================================================ */
.mmt-grid {
    background: var(--mmt-bg-subtle) !important;
    border-radius: var(--mmt-radius-lg) !important;
    border: 1px solid var(--mmt-border) !important;
    padding: 24px !important;
}

.mmt-checkbox-wrap {
    background: var(--mmt-bg-subtle) !important;
    border-radius: var(--mmt-radius-md) !important;
    padding: 16px 20px !important;
    border: 1px solid var(--mmt-border) !important;
}

/* ============================================================
   6. TABLE - Modern dengan hover row
   ============================================================ */
.mmt-cart-table,
.mmt-mkt-table,
.mmt-hist-table,
.mmt-detail-table {
    border-radius: var(--mmt-radius-md) !important;
    overflow: hidden;
    border: 1px solid var(--mmt-border) !important;
}

.mmt-cart-table thead th,
.mmt-mkt-table thead th,
.mmt-hist-table thead th,
.mmt-detail-table thead th {
    background: var(--mmt-bg-subtle) !important;
    font-weight: 700 !important;
    font-size: 11px !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mmt-text-secondary) !important;
    padding: 14px 12px !important;
    border-bottom: 1px solid var(--mmt-border-strong) !important;
}

.mmt-cart-table tbody td,
.mmt-mkt-table tbody td,
.mmt-hist-table tbody td,
.mmt-detail-table tbody td {
    padding: 16px 12px !important;
    border-bottom: 1px solid var(--mmt-border) !important;
    font-weight: 500;
    color: var(--mmt-text-primary) !important;
}

.mmt-cart-table tbody tr,
.mmt-mkt-table tbody tr,
.mmt-hist-table tbody tr {
    transition: all 0.2s var(--mmt-ease);
}

.mmt-cart-table tbody tr:hover,
.mmt-mkt-table tbody tr:hover,
.mmt-hist-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.04) !important;
    transform: scale(1.005);
}

/* ============================================================
   7. BADGES - Modern pill style
   ============================================================ */
.mmt-badge,
.mmt-badge-status,
.mmt-badge-type,
.mmt-badge-ukuran,
.mmt-badge-finishing {
    border-radius: 100px !important;
    padding: 5px 12px !important;
    font-weight: 700 !important;
    font-size: 10px !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ============================================================
   8. MODAL - Modern dengan smooth animation
   ============================================================ */
.mmt-modal-overlay {
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    animation: mmtFadeIn 0.3s var(--mmt-ease);
}

@keyframes mmtFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.mmt-modal {
    border-radius: var(--mmt-radius-xl) !important;
    padding: 32px !important;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px var(--mmt-border) !important;
    animation: mmtModalSlideUp 0.35s var(--mmt-ease-bounce);
    max-width: 720px;
}

@keyframes mmtModalSlideUp {
    from { 
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mmt-modal-close {
    background: var(--mmt-bg-subtle) !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    font-size: 22px !important;
    transition: all 0.2s var(--mmt-ease);
    border: none;
}

.mmt-modal-close:hover {
    background: var(--mmt-danger-1) !important;
    color: #fff !important;
    transform: rotate(90deg) scale(1.1);
}

/* ============================================================
   9. STATS CARD - Modern
   ============================================================ */
.mmt-stat-card,
.mmt-stat-card.green {
    border-radius: var(--mmt-radius-lg) !important;
    padding: 24px 28px !important;
    box-shadow: var(--mmt-shadow-md) !important;
    transition: all 0.3s var(--mmt-ease);
}

.mmt-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--mmt-shadow-lg) !important;
}

.mmt-stat-label {
    font-weight: 700 !important;
    letter-spacing: 0.08em;
    font-size: 11px !important;
}

.mmt-stat-value {
    font-weight: 800 !important;
    font-size: 32px !important;
    letter-spacing: -0.03em;
}

/* ============================================================
   10. ACTION BUTTONS di tabel (Edit, Hapus, dll)
   ============================================================ */
.mmt-action-btn {
    border-radius: var(--mmt-radius-sm) !important;
    padding: 8px 14px !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    transition: all 0.2s var(--mmt-ease) !important;
    border: none;
}

.mmt-action-btn:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: var(--mmt-shadow-sm);
}

/* ============================================================
   11. ALERT MESSAGES - Modern
   ============================================================ */
.mmt-alert {
    border-radius: var(--mmt-radius-md) !important;
    padding: 16px 20px !important;
    font-weight: 600;
    border-left-width: 4px !important;
    animation: mmtAlertSlide 0.4s var(--mmt-ease);
}

@keyframes mmtAlertSlide {
    from { 
        opacity: 0;
        transform: translateX(-10px);
    }
    to { 
        opacity: 1;
        transform: translateX(0);
    }
}

.mmt-alert.success {
    background: rgba(16, 185, 129, 0.1) !important;
    color: #059669 !important;
    border-color: #10b981 !important;
}

.mmt-alert.error {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #dc2626 !important;
    border-color: #ef4444 !important;
}

/* ============================================================
   12. SUCCESS PAGE - Modern
   ============================================================ */
.mmt-success-page {
    background: var(--mmt-bg-card) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border-radius: var(--mmt-radius-xl) !important;
    padding: 48px 40px !important;
    box-shadow: var(--mmt-shadow-lg) !important;
    border: 1px solid var(--mmt-border) !important;
    animation: mmtSuccessPop 0.5s var(--mmt-ease-bounce);
}

@keyframes mmtSuccessPop {
    0% { 
        opacity: 0;
        transform: scale(0.9);
    }
    60% { 
        transform: scale(1.02);
    }
    100% { 
        opacity: 1;
        transform: scale(1);
    }
}

.mmt-success-icon {
    animation: mmtSuccessBounce 0.8s var(--mmt-ease-bounce);
}

@keyframes mmtSuccessBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.mmt-success-title {
    font-weight: 800 !important;
    letter-spacing: -0.03em;
    background: var(--mmt-success-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mmt-success-btn {
    border-radius: var(--mmt-radius-md) !important;
    padding: 16px 32px !important;
    font-weight: 700 !important;
    transition: all 0.3s var(--mmt-ease) !important;
}

.mmt-success-btn-wa {
    background: var(--mmt-success-gradient) !important;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3) !important;
}

.mmt-success-btn-wa:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.45) !important;
}

/* ============================================================
   13. SKELETON LOADING (optional)
   ============================================================ */
.mmt-loading-skeleton {
    background: linear-gradient(90deg, 
        var(--mmt-bg-subtle) 25%, 
        rgba(99, 102, 241, 0.08) 50%, 
        var(--mmt-bg-subtle) 75%
    );
    background-size: 200% 100%;
    animation: mmtSkeleton 1.5s infinite;
    border-radius: var(--mmt-radius-sm);
}

@keyframes mmtSkeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================
   14. RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
    .mmt-container,
    .mmt-cart-page,
    .mmt-mkt-page,
    .mmt-hist-page {
        padding: 24px 20px !important;
        border-radius: var(--mmt-radius-lg) !important;
    }
    
    .mmt-modal {
        padding: 24px !important;
        border-radius: var(--mmt-radius-lg) !important;
    }
    
    .mmt-container h2 {
        font-size: 20px !important;
    }
    
    .mmt-btn,
    .mmt-btn-action,
    .mmt-cart-badge {
        padding: 12px 20px !important;
        font-size: 13px !important;
    }
}

/* ============================================================
   15. SCROLLBAR (Webkit) - Modern minimalis
   ============================================================ */
.mmt-suggestions::-webkit-scrollbar,
.mmt-modal::-webkit-scrollbar {
    width: 8px;
}

.mmt-suggestions::-webkit-scrollbar-track,
.mmt-modal::-webkit-scrollbar-track {
    background: var(--mmt-bg-subtle);
    border-radius: 100px;
}

.mmt-suggestions::-webkit-scrollbar-thumb,
.mmt-modal::-webkit-scrollbar-thumb {
    background: var(--mmt-primary-1);
    border-radius: 100px;
}

.mmt-suggestions::-webkit-scrollbar-thumb:hover,
.mmt-modal::-webkit-scrollbar-thumb:hover {
    background: var(--mmt-primary-2);
}