/* ================================================================
   BUKUMAX - COMPONENTS STYLESHEET
   Tombol, Card, Badge, Modal, Form Tambahan
   ================================================================ */

/* ==================== BUTTONS ==================== */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.96);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 11px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 16px 24px;
    font-size: 15px;
    border-radius: var(--radius-lg);
}

.btn-block {
    width: 100%;
}

/* Variants */
.btn-primary-solid {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

.btn-secondary-solid {
    background: var(--secondary);
    color: white;
    box-shadow: 0 4px 12px rgba(217, 70, 239, 0.25);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.25);
}

.btn-warning {
    background: var(--warning);
    color: white;
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.25);
}

.btn-ghost {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-ghost:active {
    background: var(--primary-lighter);
}

.btn-light {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.badge-primary {
    background: var(--primary-lighter);
    color: var(--primary);
}

.badge-success {
    background: var(--success-light);
    color: var(--success-dark);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger-dark);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.badge-info {
    background: var(--info-light);
    color: var(--info);
}

.badge-solid {
    background: var(--gradient-primary);
    color: white;
}

/* ==================== CARDS ==================== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all 0.2s;
}

.card-hover:active {
    transform: scale(0.98);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.card-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i {
    color: var(--primary);
}

/* ==================== FORM ELEMENTS ==================== */
.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-label .optional {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 10px;
    margin-left: 4px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-elevated);
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

.form-control:disabled {
    background: var(--bg-hover);
    color: var(--text-muted);
    cursor: not-allowed;
}

.form-control::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.form-control-icon {
    position: relative;
}

.form-control-icon > i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
    z-index: 1;
}

.form-control-icon .form-control {
    padding-left: 42px;
}

.form-hint {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row .form-group {
    flex: 1;
    min-width: 0;
}

/* ==================== SWITCH/TOGGLE ==================== */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border-medium);
    border-radius: var(--radius-pill);
    transition: 0.3s;
}

.switch-slider:before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.switch input:checked + .switch-slider {
    background: var(--gradient-primary);
}

.switch input:checked + .switch-slider:before {
    transform: translateX(20px);
}

/* ==================== EMPTY STATE ==================== */
.empty-state-bm {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border-medium);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    background: var(--bg-hover);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.empty-state-icon i {
    font-size: 28px;
    color: var(--text-muted);
}

.empty-state-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.empty-state-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

/* ==================== LOADING SPINNER ==================== */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== MODAL (CENTER) ==================== */
.modal-center-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 27, 75, 0.6);
    backdrop-filter: blur(4px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-center {
    background: white;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.25s ease-out;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-center-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-light);
}

.modal-center-header h3 {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-center-header h3 i {
    color: var(--primary);
    font-size: 18px;
}

.modal-center-close {
    width: 34px;
    height: 34px;
    background: var(--bg-hover);
    border: none;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-center-close:active {
    transform: scale(0.9);
    background: var(--danger-light);
    color: var(--danger);
}

.modal-center-body {
    padding: 20px;
}

.modal-center-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-elevated);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.modal-center-footer .btn {
    flex: 1;
}

/* ==================== ACCORDION ==================== */
.accordion-bm {
    background: white;
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.accordion-header-bm {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.accordion-header-bm:active {
    background: var(--bg-hover);
}

.accordion-title-bm {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.accordion-title-bm i {
    color: var(--primary);
}

.accordion-arrow-bm {
    color: var(--text-muted);
    font-size: 12px;
    transition: transform 0.3s;
}

.accordion-arrow-bm.open {
    transform: rotate(180deg);
}

.accordion-body-bm {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 16px;
    background: var(--bg-elevated);
}

.accordion-body-bm.open {
    max-height: 800px;
    padding: 16px;
    border-top: 1px solid var(--border-light);
}

/* ==================== INFO CARD ==================== */
.info-card-bm {
    background: linear-gradient(135deg, #ede9fe, #fae8ff);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    gap: 12px;
    border: 1px solid var(--border-medium);
}

.info-card-icon {
    width: 36px;
    height: 36px;
    background: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-card-icon i {
    color: var(--primary);
    font-size: 16px;
}

.info-card-content {
    flex: 1;
    min-width: 0;
}

.info-card-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 4px;
}

.info-card-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ==================== WARNING CARD ==================== */
.warning-card-bm {
    background: var(--warning-light);
    border: 1px solid #fbbf24;
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    gap: 12px;
}

.warning-card-icon {
    width: 36px;
    height: 36px;
    background: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.warning-card-icon i {
    color: var(--warning-dark);
    font-size: 16px;
}

.warning-card-content {
    flex: 1;
}

.warning-card-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--warning-dark);
    margin-bottom: 4px;
}

.warning-card-desc {
    font-size: 11px;
    color: #92400e;
    line-height: 1.4;
}

/* ==================== PROGRESS BAR ==================== */
.progress-bm {
    width: 100%;
    height: 8px;
    background: var(--border-light);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress-fill-bm {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-pill);
    transition: width 0.5s ease;
}

/* ==================== DIVIDER ==================== */
.divider-bm {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    margin: 16px 0;
}

.divider-bm::before,
.divider-bm::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

/* ==================== CHIP ==================== */
.chip-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    padding: 8px 14px;
    background: white;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chip:active {
    transform: scale(0.94);
}

.chip.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

.chip i {
    font-size: 11px;
}

/* ==================== TOAST ==================== */
.toast-bm {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 20px);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 700;
    z-index: 5000;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    max-width: 90%;
}

.toast-bm.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-bm.success { background: var(--success); }
.toast-bm.error { background: var(--danger); }
.toast-bm.warning { background: var(--warning); }
.toast-bm.info { background: var(--info); }

.toast-bm i {
    font-size: 14px;
}

/* ==================== SKELETON LOADING ==================== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 12px;
    margin-bottom: 8px;
}

.skeleton-text-lg {
    height: 20px;
    margin-bottom: 10px;
}

.skeleton-card {
    height: 80px;
    margin-bottom: 10px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==================== STICKY ACTION BAR ==================== */
.sticky-action-bar {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 12px 0;
    margin: 16px -16px -16px;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.sticky-action-bar .btn {
    flex: 1;
}