/* ========================================
   COMPONENTS CSS - Komponen Global
   ======================================== */

/* ========================================
   BADGE COMPONENTS
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
}

.badge-primary {
    background-color: #f3e8ff;
    color: #6b21a5;
}

.badge-secondary {
    background-color: #f3f4f6;
    color: #4b5563;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background-color: #fed7aa;
    color: #9a3412;
}

.badge-info {
    background-color: #ffe4e6;
    color: #be123c;
}

.badge-light {
    background-color: #f3f4f6;
    color: #1f2937;
}

.badge-dark {
    background-color: #1f2937;
    color: #ffffff;
}

.badge-sm {
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
}

.badge-lg {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}

/* ========================================
   BUTTON COMPONENTS - MODERN
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    border-radius: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    font-size: 0.875rem;
}

.btn:active {
    transform: scale(0.97);
}

/* Primary Button */
.btn-primary {
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(5, 150, 105, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #047857, #065f46);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(5, 150, 105, 0.3);
}

/* Secondary Button */
.btn-secondary {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(75, 85, 99, 0.2);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(75, 85, 99, 0.3);
}

/* Success Button */
.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
    transform: translateY(-2px);
}

/* Danger Button */
.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
}

/* Warning Button */
.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #ea580c, #c2410c);
    transform: translateY(-2px);
}

/* Info Button */
.btn-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
}

/* Outline Button */
.btn-outline {
    background: transparent;
    border: 2px solid #059669;
    color: #059669;
}

.btn-outline:hover {
    background: #059669;
    color: white;
    transform: translateY(-2px);
}

/* ========================================
   ACTION ICON BUTTONS
   ======================================== */
.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    border: none;
}

.action-icon:active {
    transform: scale(0.95);
}

.action-view {
    background: #eff6ff;
    color: #3b82f6;
}

.action-view:hover {
    background: #3b82f6;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.action-edit {
    background: #ecfdf5;
    color: #10b981;
}

.action-edit:hover {
    background: #10b981;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.action-delete {
    background: #fef2f2;
    color: #ef4444;
}

.action-delete:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.action-restore {
    background: #fffbeb;
    color: #d97706;
}

.action-restore:hover {
    background: #d97706;
    color: white;
    transform: translateY(-2px);
}

.action-print {
    background: #f3e8ff;
    color: #9333ea;
}

.action-print:hover {
    background: #9333ea;
    color: white;
    transform: translateY(-2px);
}

.action-download {
    background: #e0f2fe;
    color: #0284c7;
}

.action-download:hover {
    background: #0284c7;
    color: white;
    transform: translateY(-2px);
}

/* ========================================
   CARD COMPONENTS
   ======================================== */
.card {
    background-color: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid #f3f4f6;
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

/* ========================================
   ALERT COMPONENTS
   ======================================== */
.alert-success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    padding: 1rem;
    border-radius: 0.75rem;
    border-left: 4px solid #10b981;
    margin-bottom: 1rem;
}

.alert-error {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    padding: 1rem;
    border-radius: 0.75rem;
    border-left: 4px solid #ef4444;
    margin-bottom: 1rem;
}

.alert-warning {
    background: linear-gradient(135deg, #fed7aa, #fde68a);
    color: #92400e;
    padding: 1rem;
    border-radius: 0.75rem;
    border-left: 4px solid #f59e0b;
    margin-bottom: 1rem;
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
    padding: 1rem;
    border-radius: 0.75rem;
    border-left: 4px solid #3b82f6;
    margin-bottom: 1rem;
}

/* ========================================
   TABLE COMPONENTS
   ======================================== */
.table-wrapper {
    overflow-x: auto;
}

.table {
    width: 100%;
    font-size: 0.875rem;
}

.table thead {
    background-color: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.table tbody tr:hover {
    background-color: #f9fafb;
}

/* ========================================
   FORM COMPONENTS
   ======================================== */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-input.is-invalid,
.form-select.is-invalid,
.form-textarea.is-invalid {
    border-color: #ef4444;
}

.form-error {
    font-size: 0.75rem;
    color: #ef4444;
    margin-top: 0.25rem;
}

/* ========================================
   STAT CARD COMPONENTS
   ======================================== */
.stat-card {
    border-radius: 1rem;
    padding: 1.25rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.stat-card-content {
    position: relative;
    z-index: 10;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.8;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

.stat-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    opacity: 0.2;
    z-index: 0;
}

/* ========================================
   AVATAR COMPONENTS
   ======================================== */
.avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    font-weight: 700;
    text-transform: uppercase;
}

.avatar-sm {
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
}

.avatar-md {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.875rem;
}

.avatar-lg {
    width: 3rem;
    height: 3rem;
    font-size: 1rem;
}

/* ========================================
   PAGINATION COMPONENTS
   ======================================== */
.pagination-wrapper {
    background-color: #f9fafb;
    padding: 0.75rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ========================================
   EMPTY STATE COMPONENTS
   ======================================== */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1rem;
    background-color: #f3f4f6;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #9ca3af;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .btn {
        padding: 0.375rem 1rem;
        font-size: 0.75rem;
    }
    
    .action-icon {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .pagination-wrapper {
        flex-direction: column;
        gap: 0.5rem;
    }
}