/* ==========================================================================
   Donasi Puden - Modern Design System (Saweria Style)
   donasi.puden.app
   ========================================================================== */

:root {
    --bg-base: #090d16;
    --bg-card: rgba(17, 24, 39, 0.85);
    --bg-card-hover: rgba(31, 41, 55, 0.95);
    --bg-input: rgba(15, 23, 42, 0.9);
    --bg-glass: rgba(15, 23, 42, 0.75);

    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --primary-glow: rgba(139, 92, 246, 0.35);
    --secondary: #06b6d4;
    --accent: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(139, 92, 246, 0.5);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px var(--primary-glow);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(139, 92, 246, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.1) 0%, transparent 45%);
    background-attachment: fixed;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: #a78bfa;
}

/* ==========================================================================
   Typography & Utilities
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    color: #ffffff;
    font-weight: 700;
    line-height: 1.25;
}

.text-gradient {
    background: linear-gradient(135deg, #a78bfa 0%, #ec4899 50%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-center { text-align: center; }

/* ==========================================================================
   Header & Navbar
   ========================================================================== */
.navbar {
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 14px 0;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ==========================================================================
   Containers & Grids
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-narrow {
    max-width: 680px;
}

.main-content {
    flex: 1;
    padding: 32px 0 60px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

@media (max-width: 900px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Cards & Panels
   ========================================================================== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: all 0.25s ease;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.18);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
}

/* Stat Widget Cards */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-icon.purple { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.stat-icon.green  { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.stat-icon.blue   { background: rgba(6, 182, 212, 0.15);  color: #38bdf8; }
.stat-icon.amber  { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #ffffff;
    margin-top: 4px;
}

/* ==========================================================================
   Buttons (Strict minimum 8-12px gaps per workspace rules)
   ========================================================================== */
.btn-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 22px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-sizing: border-box;
    white-space: nowrap;
    margin: 0;
}

.btn:disabled, .btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #9333ea);
    color: #ffffff;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
    color: #ffffff;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    border-color: var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
}

.btn-sm {
    height: 38px;
    padding: 0 14px;
    font-size: 0.85rem;
}

.btn-lg {
    height: 52px;
    padding: 0 28px;
    font-size: 1.05rem;
    border-radius: var(--radius-lg);
}

.btn-block {
    width: 100%;
}

/* ==========================================================================
   Form Controls (Strict 48px standard & select clipping fix)
   ========================================================================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 8px;
}

.form-label .required {
    color: var(--danger);
    margin-left: 4px;
}

.form-control,
input[type="text"],
input[type="email"],
input[type="number"],
input[type="url"],
select.form-control {
    width: 100%;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0 16px !important;
    line-height: 46px !important;
    box-sizing: border-box !important;
    outline: none;
    transition: all 0.2s ease;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(15, 23, 42, 0.98);
}

/* SELECT TEXT CLIPPING FIX (DirectWrite Chromium standard per rules) */
select.form-control {
    padding: 0 42px 0 16px !important;
    line-height: 46px !important;
    vertical-align: middle !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    cursor: pointer;
}

select option {
    background-color: #0f172a;
    color: #ffffff;
    padding: 12px;
}

/* TEXTAREA (Auto-height multi-line) */
textarea.form-control {
    width: 100%;
    height: auto !important;
    min-height: 110px !important;
    max-height: none !important;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6 !important;
    padding: 14px 16px !important;
    box-sizing: border-box !important;
    outline: none;
    resize: vertical;
}

/* SEAMLESS INPUT GROUPS (No stepping defect per rules) */
.input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.input-group-prepend,
.input-group-append {
    display: flex;
    align-items: center;
    height: 48px !important;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    box-sizing: border-box !important;
    margin: 0 !important;
}

.input-group-prepend {
    border: 1px solid var(--border) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group .form-control {
    border-radius: 0 var(--radius-md) var(--radius-md) 0 !important;
    border-left: none !important;
    flex: 1;
}

/* ==========================================================================
   Pill Amounts & Media Selector
   ========================================================================== */
.amount-pills {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.amount-pill {
    height: 46px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.amount-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(139, 92, 246, 0.4);
}

.amount-pill.active {
    background: linear-gradient(135deg, var(--primary), #9333ea);
    border-color: #a78bfa;
    box-shadow: 0 4px 15px var(--primary-glow);
}

/* Media selector tabs */
.media-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.media-tab {
    flex: 1;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.media-tab:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.media-tab.active {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--primary);
    color: #ffffff;
}

/* GIF Picker Grid */
.gif-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-height: 240px;
    overflow-y: auto;
    padding: 6px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.gif-item {
    aspect-ratio: 1/1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.gif-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gif-item:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.4);
}

.gif-item.active {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* ==========================================================================
   Tables
   ========================================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
    font-size: 0.92rem;
    vertical-align: middle;
}

.table tbody tr {
    transition: background 0.15s ease;
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge-paid, .badge-success { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-pending, .badge-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-failed, .badge-danger { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-admin { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }
.badge-author { background: rgba(6, 182, 212, 0.15); color: #38bdf8; border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-user { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-backdrop.show {
    display: flex;
    animation: modalFadeIn 0.2s ease-out;
}

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

.modal-content {
    background: #0f172a;
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    position: relative;
    animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from { transform: translateY(20px) scale(0.97); }
    to { transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #ffffff;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: 100%;
    pointer-events: none;
}

.toast {
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    animation: toastSlideIn 0.25s ease-out;
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-error   { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }

@keyframes toastSlideIn {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    border-top: 1px solid var(--border);
    padding: 24px 0;
    background: rgba(11, 15, 25, 0.6);
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
    margin-top: auto;
}