/* assets/css/style.css */
:root {
    /* --- M3 CORE PALETTE --- */
    --m3-primary: #1a73e8;
    --m3-on-primary: #FFFFFF;
    --m3-outline: #79747E;
    --m3-surface: #F8F9FA; /* Surface Container Low */
    --m3-surface-container: #FFFFFF; /* Surface Container High (Card) */
    
    /* --- SURFACES (HIERARCHY) --- */
    --m3-blue-surface: #F0F4F8; /* Lebih dingin & premium */
    --m3-blue-container: #E8F0FE;
    --m3-on-surface: #1C1B1F;
    
    /* --- PREMIUM ACCENTS --- */
    --premium-gradient: linear-gradient(135deg, #1a73e8 0%, #0b57d0 100%);
    --premium-shadow: 0 10px 20px -5px rgba(26, 115, 232, 0.3);
    --premium-orange: #f97316;
    --premium-amber: #fbbf24;
    --orange-glow: rgba(249, 115, 22, 0.25); /* Glow lebih kuat */
    --blue-glow: rgba(26, 115, 232, 0.20);

    /* --- GLASS EFFECT (FROSTED) --- */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-blur: 16px;

    /* --- M3 ELEVATION (SHADOWS) --- */
    /* Level 1: Card Diam */
    --elevation-1: 0px 1px 2px rgba(0,0,0,0.08), 0px 1px 3px 1px rgba(0,0,0,0.05);
    /* Level 2: Card Hover */
    --elevation-2: 0px 1px 2px rgba(0,0,0,0.08), 0px 2px 6px 2px rgba(0,0,0,0.05);
    /* Level 3: Modal/Dialog */
    --elevation-3: 0px 4px 8px 3px rgba(0,0,0,0.05), 0px 1px 3px rgba(0,0,0,0.1);

    /* --- MOTION --- */
    --motion-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --motion-standard: cubic-bezier(0.2, 0, 0, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

body { 
    background-color: var(--m3-blue-surface); 
    color: var(--m3-on-surface); 
    font-family: "Roboto Flex", "Google Sans", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #C4C7C5; border-radius: 10px; border: 2px solid var(--m3-surface); }
::-webkit-scrollbar-thumb:hover { background: #8E918F; }

h1, h2, h3, h4, h5, h6 { color: #001C35; font-weight: 700; letter-spacing: -0.02em; }
p { color: var(--m3-on-surface-variant); }

/* ============================================================
   MATERIAL DESIGN 3 – STATE LAYER
   ============================================================ */

   .m3-state {
    position: relative;
    overflow: hidden;
  }
  
  .m3-state::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: currentColor;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s var(--md-sys-motion-standard);
  }
  
  .m3-state:hover::after {
    opacity: var(--md-sys-state-hover-opacity);
  }
  
  .m3-state:active::after {
    opacity: var(--md-sys-state-pressed-opacity);
  }

/* ============================================================
   MATERIAL DESIGN 3 – ELEVATION SCALE
   ============================================================ */

   .m3-elevation-0 { box-shadow: none; }
   .m3-elevation-1 { box-shadow: var(--elevation-1); }
   .m3-elevation-2 { box-shadow: var(--elevation-2); }
   .m3-elevation-3 { box-shadow: var(--elevation-3); }

/* ============================================================
MATERIAL DESIGN 3 – TYPOGRAPHY SCALE
============================================================ */

.m3-headline-large {
    font-size: 32px;
    font-weight: 500;
    letter-spacing: -0.25px;
  }
  
  .m3-headline-medium {
    font-size: 28px;
    font-weight: 500;
  }
  
  .m3-title-large {
    font-size: 22px;
    font-weight: 500;
  }
  
  .m3-title-medium {
    font-size: 16px;
    font-weight: 500;
  }
  
  .m3-body-large {
    font-size: 16px;
  }
  
  .m3-body-medium {
    font-size: 14px;
  }
  
  .m3-label-medium {
    font-size: 12px;
    font-weight: 500;
  }
  
/* 3. CUSTOM SCROLLBAR (Premium Look) */
textarea::-webkit-scrollbar { width: 6px; }
body::-webkit-scrollbar, 
div::-webkit-scrollbar { 
    width: 6px; 
    height: 6px; 
}
textarea::-webkit-scrollbar-track, 
body::-webkit-scrollbar-track, 
div::-webkit-scrollbar-track { 
    background: transparent; 
}
textarea::-webkit-scrollbar-thumb { 
    background-color: #CBD5E1; 
    border-radius: 20px; 
}

body::-webkit-scrollbar-thumb, 
div::-webkit-scrollbar-thumb { 
    background-color: #CBD5E1; 
    border-radius: 20px; 
}
textarea::-webkit-scrollbar-thumb:hover { 
    background-color: #94A3B8; 
}

.style-helper {
    /* Mencegah pergeseran tata letak saat konten berubah */
    min-height: 200px; 
}

/* Material Design 3 Components */
.m3-card { 
    border-radius: 28px; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
}

.m3-card-base { 
    background: #FFFFFF; 
    border-radius: 28px; 
    border: 1px solid #DEE1E6; 
    transition: box-shadow 0.3s ease; 
}

/* ============================================================
   IKON & TOMBOL (GABUNGAN & REVISI)
   ============================================================ */

.material-symbols-rounded { 
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: font-variation-settings 0.2s ease;
}

.m3-btn-primary { 
    background-color: var(--m3-blue-primary); 
    color: white; 
    border-radius: 100px; 
    padding: 10px 24px;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    transition: all 0.3s var(--motion-spring);
}

.m3-btn-primary:hover { 
    background-color: #1765cc; 
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26, 115, 232, 0.3);
}

.m3-btn-filled {
    background-color: var(--m3-primary);
    color: white;
    padding: 0 24px;
    height: 48px;
    border-radius: 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    letter-spacing: 0.1px;
    border: none;
    cursor: pointer;
    transition: box-shadow 0.2s;
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    transition: all 0.3s var(--motion-spring);
}

.m3-btn-filled:hover {
    box-shadow: 0 1px 3px rgba(0,0,0,0.2), 0 2px 6px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26, 115, 232, 0.3);
}

/* Efek Klik (Active): Mengecil sedikit (Tactile Feedback) */
.m3-btn-primary:active, .m3-btn-filled:active, 
.btn-blue-premium:active, .btn-orange-premium:active {
    transform: scale(0.96) translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
/* ============================================================
   FORM & INPUTS
   ============================================================ */

.m3-input-field, .m3-filled-input {
    width: 100%;
    background-color: rgba(241, 243, 244, 0.5) !important;
    border: 1.5px solid transparent !important;
    border-radius: 16px;
    backdrop-filter: blur(4px);
    padding: 16px;
    font-family: inherit; font-size: 0.95rem; outline: none;
    color: var(--m3-on-surface);
    transition: all 0.2s;
}

.m3-input-field:focus,
.m3-input-field:focus-within,
.m3-filled-input:focus {
    background-color: #ffffff !important;
    border-color: #f97316 !important; /* Fokus warna Orange */
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.1) !important; /* Glow Orange */
}

.m3-field-wrapper {
    position: relative;
    margin-bottom: 24px;
    width: 100%;
}

.m3-input {
    width: 100%;
    height: 56px;
    padding: 16px;
    font-size: 16px;
    border: 1px solid var(--m3-outline);
    border-radius: 12px;
    background: transparent;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
}

.m3-input:focus {
    border: 2px solid var(--m3-primary);
}

.m3-label {
    position: absolute;
    left: 12px;
    top: 16px;
    padding: 0 4px;
    background: var(--m3-surface-container);
    color: var(--m3-outline);
    font-size: 16px;
    pointer-events: none;
    transition: 0.2s ease all;
}

.m3-input:focus ~ .m3-label,
.m3-input:not(:placeholder-shown) ~ .m3-label {
    top: -10px;
    left: 10px;
    font-size: 12px;
    color: var(--m3-primary);
    font-weight: 500;
}

.m3-textarea {
    height: auto;
    min-height: 150px;
    resize: none;
}

/* ============================================================
   NAVIGASI & DROPDOWN (FIXED TRANSPARENCY)
   ============================================================ */

.m3-dropdown { 
    border-radius: 24px; 
    box-shadow: 0 8px 32px rgba(0,0,0,0.12); 
    border: 1px solid #DEE1E6; 
    background-color: #ffffff; /* Latar belakang solid */
    z-index: 100;
}

#mobileMenu {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
}

#mobileMenu.active {
    max-height: 80vh;
    opacity: 1;
    overflow-y: auto;
}

/* ============================================================
   LAYOUT COMPONENTS
   ============================================================ */

.m3-container {
    max-width: 840px;
    margin: 0 auto;
    background: var(--m3-surface-container);
    border-radius: 28px;
    padding: 48px;
    border: 1px solid #DEE1E6;
}

.m3-icon-circle {
    width: 56px;
    height: 56px;
    background-color: var(--m3-blue-container);
    color: var(--m3-blue-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.m3-header-icon {
    width: 64px;
    height: 64px;
    background: #E8F0FE;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--m3-primary);
    margin-bottom: 24px;
}
@keyframes shimmer {
    100% { transform: translateX(100%); }
}

.m3-notification-dot {
    animation: m3-dot-scale 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes m3-dot-scale {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

#modalBackdrop, #modalContent {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================
   PRATINJAU AKADEMIK (Daftar Pustaka, Cover, dll)
   ============================================================ */

/* 1. SETUP KERTAS & LAYOUT */
#previewPaper h2 {
    text-align: center !important;
    width: 100% !important;
    margin: 0 !important;
    display: block !important;
}

.academic-paper, .paper-a4 {
    display: block !important;
    box-sizing: border-box !important;
    background: white;
    text-align: left !important;
    overflow-y: visible !important;
}

.paper-a4 { width: 210mm; height: 297mm; padding: 30mm 25mm 25mm 25mm; }
.paper-f4 { width: 215mm; height: 330mm; }
.paper-legal { width: 216mm; height: 356mm; }
.paper-letter { width: 216mm; height: 279mm; }

#previewPaper.academic-paper {
    height: auto !important; 
    min-height: 297mm !important; 
    display: block !important;
    padding-bottom: 50mm !important;
    margin-bottom: 50px;
    margin-left: auto !important;
    margin-right: auto !important;
}

#printArea.paper-a4 {
    display: block !important;
    width: 210mm !important;
    min-height: 297mm !important;
    padding: 30mm 25mm 25mm 25mm !important;
    background: white;
}

/* --- CITATION LIST STYLING (FINAL CLEAN) --- */

/* A. Item Wrapper (Block & Reset) */
#citationList .citation-item {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    margin-bottom: 12pt !important;
    padding: 0 !important; 
    text-indent: 0 !important;
    margin-left: 0 !important;
    background: transparent;
}

/* B. Content Text (MUTLAK: Hanging Indent) */
#citationList .citation-content {
    display: block !important;
    
    /* RUMUS HANGING INDENT */
    padding-left: 1.27cm !important; /* Dorong semua ke kanan */
    text-indent: -1.27cm !important; /* Tarik baris pertama ke kiri */
    
    /* Typography */
    text-align: justify !important;
    line-height: 1.5 !important;
    color: black !important;
    font-family: 'Times New Roman', serif !important;
    font-size: 12pt !important;
    
    /* Text Wrap */
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    
    margin: 0 !important;
}

/* C. Italics Handling */
#citationList .citation-content i, 
#citationList .citation-content em {
    font-style: italic !important;
    font-weight: normal !important;
    color: inherit !important;
}

/* D. Hover Effect */
#citationList .citation-item:hover {
    background-color: rgba(26, 115, 232, 0.04) !important;
    border-radius: 8px;
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.04); 
}

/* E. Edit Mode (Reset Indent agar nyaman diketik) */
#citationList .citation-item:has(textarea),
#citationList .citation-item:has(.edit-textarea) {
    padding: 10px !important;
    background: #f8fbff !important;
    border: 1px solid #1a73e8 !important;
    border-radius: 12px;
}

#citationList .citation-item:has(textarea) .citation-content,
#citationList .citation-item:has(.edit-textarea) .citation-content {
    padding-left: 0 !important;
    text-indent: 0 !important;
}

/* F. Helper untuk Edit/Delete */
.citation-item:has(.editable-content:empty) { display:none; }
.citation-actions { pointer-events: auto !important; }

/* --- PREVIEW CONTAINER LAYOUT --- */
.preview-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    overflow-y: auto !important; 
    overflow-x: hidden;
    background: #E9EEF6;
    border-radius: 28px;
    padding: 20px 10px;
}

.preview-container {
    width: 100%;
    display: flex;
    justify-content: center;
    transform-origin: top center;
    height: auto; 
    padding-bottom: 50px;
}

.preview-container #citationList { width: 100%; display: block !important; }
#previewPaper:has(#citationList) { justify-content: flex-start !important; display: block !important; }
#printArea:not(:has(#citationList)) { justify-content: flex-start !important; }

/* --- RESPONSIVITAS --- */
@media (max-width: 1024px) {
    .preview-container { transform: scale(0.45); margin-bottom: -160mm; }
}

@media (max-width: 768px) {
    .preview-container { transform: scale(0.48); margin-bottom: -155mm; }
    .preview-wrapper { padding: 20px 5px; overflow-x: hidden; }
}

@media (max-width: 640px) {
    .preview-container { 
        transform: scale(0.88) !important; 
        width: 100%;
        display: flex;
        justify-content: center;
        transform-origin: top center;
    }
    .preview-wrapper {
        height: auto !important;
        padding: 20px 0 100px 0 !important;
        background: #E9EEF6;
    }
    #printArea.paper-a4 {
        height: auto !important;
        min-height: 220mm !important;
    }
    /* Perkecil indent di HP agar muat */
    .citation-content {
        padding-left: 1rem !important; 
        text-indent: -1rem !important;
    }
}

/* --- EDIT TEXTAREA --- */
.edit-textarea {
    width: 100%;
    background-color: #ffffff;
    border: 2px solid #1a73e8;
    border-radius: 12px;
    padding: 12px;
    font-family: 'Roboto Flex', 'Google Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 11pt;
    outline: none;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.15);
    resize: vertical;
    display: block;
    margin-bottom: 8px;
}
.edit-actions { display: flex; gap: 8px; margin-top: 8px; padding-left: 4px; }

/* 6. KONFIGURASI CETAK (MEDIA PRINT) */
@media print {
    /* Hide UI */
    nav, footer, header, aside, .no-print, button, .header-main, #clearAllContainer, .edit-actions, #extractionGuide, #methodManual, #methodAuto {
        display: none !important;
    }

    /* Reset Kanvas */
    html, body, .preview-wrapper, .preview-container {
        background: white !important;
        height: auto !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Kertas */
    #printArea, .academic-paper {
        display: block !important;
        position: relative !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        background-color: transparent !important;
    }

    /* Indentasi Cetak (Sama dengan Preview) */
    .citation-item {
        display: block !important;
        margin-bottom: 12pt !important;
        page-break-inside: avoid;
        position: relative !important;
        z-index: 2 !important;
    }

    .citation-content {
        display: block !important;
        padding-left: 1.27cm !important;
        text-indent: -1.27cm !important;
        text-align: justify !important;
        font-family: "Times New Roman", serif !important;
        font-size: 12pt !important;
        line-height: 1.5 !important;
        color: black !important;
        background: transparent !important;
    }

    a { word-break: break-all !important; text-decoration: none !important; color: black !important; }

    /* Watermark Full Page (Pola Berulang) */
    .watermark-full-page {
        display: block !important;
        position: absolute !important;
        top: 0; left: 0; right: 0; bottom: 0;
        width: 100% !important;
        height: 100% !important;
        z-index: 1 !important; 
        pointer-events: none !important;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Ctext transform='translate(20, 100) rotate(-45)' fill='rgba(0,0,0,0.15)' font-size='20' font-family='Arial' font-weight='bold'%3Ewww.kutipin.com%3C/text%3E%3C/svg%3E") !important;
        background-repeat: repeat !important;
        background-position: center !important;
    }
    
    #watermark-print { display: none !important; }

    @page { size: A4; margin: 30mm 30mm 30mm 40mm; }
}

@keyframes blob {
    0% { transform: translate(0px, 0px) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0px, 0px) scale(1); }
}
.animate-blob { animation: blob 7s infinite; }
.animation-delay-2000 { animation-delay: 2s; }
.animation-delay-4000 { animation-delay: 4s; }

@media (max-height: 700px) and (max-width: 640px) {
    .preview-container {
        margin-bottom: -120mm !important;
    }
}

/* ============================================================
   ADDITIONAL M3 COMPONENTS
   ============================================================ */

.m3-surface-tonal {
    background-color: var(--m3-blue-surface);
    min-height: 100vh;
}

.m3-hero-header {
    background-color: #ffffff;
    border-bottom: 1px solid rgba(222, 225, 230, 0.5);
}

.m3-card-interactive {
    background: #FFFFFF;
    border-radius: 28px; /* Konsisten 28px */
    border: 1px solid rgba(0, 0, 0, 0.05); /* Border sangat halus */
    padding: 32px;
    transition: all 0.4s var(--motion-spring);
    position: relative;
}

.m3-card-interactive:hover {
    background: #FFFFFF;
    border-color: rgba(26, 115, 232, 0.3); /* Biru tipis saat hover */
    box-shadow: var(--elevation-2); /* Elevasi naik */
    transform: translateY(-4px);
}

.m3-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #ffffff;
    padding: 16px;
    border-radius: 32px;
    border: 1px solid #DEE1E6;
}

.m3-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    color: #444746;
    border: none;
    background: transparent;
    cursor: pointer;
}

.m3-nav-item.active {
    background-color: #D3E3FD;
    color: #041E49;
    font-weight: 600;
}

.m3-nav-item:hover:not(.active) {
    background-color: #F1F3F4;
    color: #1F1F1F;
}

.m3-chip-scroll {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.m3-chip-scroll::-webkit-scrollbar {
    display: none;
}

.m3-chip {
    white-space: nowrap;
    padding: 8px 24px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #DEE1E6;
    background: #ffffff;
    transition: all 0.2s;
}

.m3-chip.active {
    background-color: #1a73e8;
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.2);
}

.m3-table-container {
    border-radius: 24px;
    border: 1px solid #DEE1E6;
    overflow: hidden;
}

.m3-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.m3-table th {
    background-color: #F8F9FA;
    padding: 16px;
    text-align: left;
    font-weight: 700;
    color: #1F1F1F;
    border-bottom: 1px solid #DEE1E6;
}

.m3-table td {
    padding: 16px;
    border-bottom: 1px solid #F1F3F4;
    color: #444746;
}

.m3-badge-pro {
    background-color: #1a73e8;
    color: white;
    font-size: 9px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 100px;
    text-transform: uppercase;
}

.m3-text-headline {
    font-size: 32px;
    font-weight: 500;
    letter-spacing: -0.5px;
    color: #1F1F1F;
}

.custom-scrollbar::-webkit-scrollbar { width: 4px; display: none; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #C4C7C5; border-radius: 10px; }

.custom-scrollbar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.m3-background {
    background-color: var(--m3-blue-surface);
    position: relative;
    overflow: hidden;
    z-index: 0;
}
.m3-background::before, .m3-background::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(100px); /* Blur lebih tinggi agar halus */
    z-index: -1;
    opacity: 0.6; /* Transparansi disesuaikan */
    animation: float-premium 20s infinite alternate ease-in-out;
    mix-blend-mode: multiply;
}

/* Ornamen Biru di Kiri Atas */
.m3-background::before {
    width: 50vh;
    height: 50vh;
    background: #F3E8FF;
    top: -10%;
    left: -10%;
    animation: float 15s ease-in-out infinite;
    animation-delay: -10s;
}

/* Ornamen Ungu di Kanan Bawah */
.m3-background::after {
    width: 500px;
    height: 500px;
    background: #F3E8FF;
    bottom: -150px;
    right: -150px;
    animation: float 20s ease-in-out infinite reverse;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -20px) scale(1.1); }
    100% { transform: translate(0, 0) scale(1); }
}

@keyframes float-premium {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 50px) scale(1.1); }
}

.bg-orange-premium {
    background: linear-gradient(135deg, #f97316 0%, #fbbf24 100%);
    box-shadow: 0 10px 30px -10px rgba(249, 115, 22, 0.5);
}

.text-orange-premium {
    background: linear-gradient(to right, #f97316, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Memastikan konten tetap di atas latar belakang */
.m3-content {
    position: relative;
    z-index: 10;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.m3-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px -12px rgba(249, 115, 22, 0.15) !important; /* Rona orange tipis di bayangan */
    border-color: rgba(249, 115, 22, 0.3) !important;
}

.glass-card-premium {
    background: var(--glass-bg);
    backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 20px 25px -5px rgba(0, 0, 0, 0.05),
        inset 0 0 20px rgba(255, 255, 255, 0.5);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card-premium:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 60px -12px var(--orange-glow);
    border-color: rgba(249, 115, 22, 0.3);
}

@keyframes slow-pulse {
    0%, 100% { transform: scale(1) translate(0, 0); opacity: 0.5; }
    50% { transform: scale(1.1) translate(20px, -20px); opacity: 0.8; }
}

.bg-texture-item {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    z-index: -1;
    animation: slow-pulse 10s infinite ease-in-out;
}

.btn-blue-premium {
    /* 1. WARNA & BACKGROUND */
    background: var(--premium-gradient);
    color: white;
    border: none;
    
    /* 2. UKURAN & BENTUK (Revisi M3 Premium) */
    width: 100%;             /* Memaksa lebar penuh container */
    padding: 16px 32px;      /* Padding tebal agar gagah */
    border-radius: 100px;    /* WAJIB 100px untuk bentuk Kapsul/Pill M3 */
    
    /* 3. LAYOUT */
    display: flex;           /* Ganti inline-flex agar width 100% jalan */
    align-items: center;
    justify-content: center;
    gap: 12px;
    
    /* 4. TYPOGRAPHY */
    font-family: 'Roboto Flex', 'Google Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    font-weight: 600;        /* 700 terlalu tebal, 600 lebih elegan */
    letter-spacing: 0.5px;
    
    /* 5. EFEK & TRANSISI */
    box-shadow: 0 8px 20px -6px var(--blue-glow); /* Shadow biru lembut */
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    transition: all 0.4s var(--motion-spring);
}

/* HOVER STATE */
.btn-blue-premium:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 15px 35px -8px rgba(11, 87, 208, 0.5);
    filter: brightness(1.05);
}

/* ACTIVE STATE (KLIK) */
.btn-blue-premium:active {
    transform: scale(0.97) translateY(0);
    box-shadow: 0 4px 10px -4px rgba(11, 87, 208, 0.4);
}

/* ANIMASI IKON PANAH */
.btn-blue-premium .material-symbols-rounded {
    transition: transform 0.3s ease;
}
.btn-blue-premium:hover .material-symbols-rounded {
    transform: translateX(4px);
}

.glass-card-blue-premium {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 32px;
    box-shadow: 
        0 10px 30px -5px rgba(0, 0, 0, 0.04), 
        0 25px 50px -12px var(--blue-glow);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card-blue-premium:hover {
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-6px);
    box-shadow: 
        0 20px 40px -15px rgba(0, 0, 0, 0.1),
        0 30px 60px -12px var(--blue-glow);
    backdrop-filter: blur(20px) saturate(200%);
}

.btn-orange-premium {
    background: linear-gradient(135deg, var(--premium-orange), var(--premium-amber));
    color: white;
    box-shadow: 0 10px 20px -5px rgba(249, 115, 22, 0.3);
    border: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    transform: translateZ(0); /* Hardware acceleration */
    transition: all 0.3s var(--motion-spring);
}

.btn-orange-premium:hover {
    box-shadow: 0 15px 30px -5px rgba(249, 115, 22, 0.5);
    transform: scale(1.02);
    filter: brightness(1.1);
}

/* FAQ M3 & Glassmorphism Styles */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 28px;
}

/* ============================================================
   FAQ & ACCORDION STYLES (PREMIUM M3)
   ============================================================ */

/* 1. Filter Chips (Tombol Kategori) */
.m3-chip-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 8px 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}
.m3-chip-scroll::-webkit-scrollbar { display: none; }

.m3-chip {
    background: #FFFFFF;
    border: 1px solid #C4C7C5;
    color: #444746;
    padding: 10px 24px;
    border-radius: 100px; /* Pill Shape */
    font-family: 'Google Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.m3-chip:hover {
    background: #F0F4F9;
    border-color: #747775;
}

.m3-chip.active {
    background: #D3E3FD; /* M3 Primary Container */
    color: #041E49;       /* M3 On Primary Container */
    border-color: transparent;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    font-weight: 600;
}

/* 2. FAQ Card Wrapper */
.glass-card {
    background: #FFFFFF;
    border-radius: 28px;
    border: 1px solid #DEE1E6;
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
    overflow: hidden; /* Penting untuk border radius anak */
}

/* 7. ANIMATIONS & SATU SUARA UTILS (UPDATED) */
.hidden { display: none; }

.animate-in { animation: fadeIn 0.8s ease-out forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Typing Dot Animation (Scale Effect) */
.typing-dot {
    width: 5px;
    height: 5px;
    background: #1a73e8;
    border-radius: 50%;
    animation: typing-animation 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-animation {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1.1); opacity: 1; }
}

/* Cursor Blink Effect */
#typingContainer::after {
    content: "|";
    animation: blink 0.7s infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* =================================================================
   TAMBAHAN: GAYA KERTAS (Pindahan dari daftar-pustaka.php)
   ================================================================= */

/* 1. KANVAS & PATTERN KERTAS */
.paper-pattern {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    height: 100%;
    pointer-events: none;
    opacity: 0.05;
    background-image: url('https://www.transparenttextures.com/patterns/pinstriped-suit.png');
    z-index: 0;
}

.preview-container {
    display: flex;
    justify-content: center;
    width: 100%; 
    height: auto !important; 
    padding-bottom: 100px;
    transform-origin: top center;
}

.preview-wrapper {
    overflow-y: auto;
    overflow-x: hidden; 
    padding: 20px;
    background: #F0F2F5; 
    border-radius: 20px; 
}

/* 2. UKURAN KERTAS FISIK */
#printArea.academic-paper {
    background-color: white !important;
    display: block !important;    
    height: auto !important;      
    min-height: 297mm !important; 
    width: 210mm !important;      
    box-sizing: border-box !important; 
    margin: 0 auto !important;
    padding: 30mm 30mm 30mm 40mm !important;
    overflow: visible !important; 
    padding-bottom: 25mm !important; 
    position: relative !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1) !important;
}

/* Variasi Ukuran */
#printArea.paper-a4 { width: 210mm !important; }
#printArea.paper-f4 { width: 215mm !important; min-height: 330mm !important; }
#printArea.paper-legal { width: 216mm !important; min-height: 356mm !important; }
#printArea.paper-letter { width: 216mm !important; min-height: 279mm !important; }

/* 3. FORMAT DAFTAR PUSTAKA (HANGING INDENT) */
/* Induk (Wrapper Item) */
.citation-item {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-bottom: 12pt !important;
    color: black !important;
}

/* Anak (Konten Teks) - Di sini indentasi terjadi */
.citation-content {
    display: block !important;

    /* HANGING INDENT APA */
    padding-left: 1.27cm !important;
    text-indent: -1.27cm !important;

    font-family: "Times New Roman", Times, serif !important;
    font-size: 12pt !important;
    line-height: 1.5 !important;

    text-align: justify !important;
    color: black !important;

    white-space: normal !important;
    overflow-wrap: break-word !important;
}

/* 4. MODE EDIT (TEXTAREA) */
.citation-item:has(textarea) {
    /* Matikan indent saat edit */
    padding-left: 0 !important;
    text-indent: 0 !important;
    background: #f8fbff !important;
    border-radius: 12px;
    padding: 10px !important;
}

/* 6. KONFIGURASI CETAK (MEDIA PRINT) */
@media print {
    /* Sembunyikan UI Web */
    nav, footer, header, aside, .no-print, button, 
    .header-main, #clearAllContainer, .edit-actions, 
    #extractionGuide, #methodManual, #methodAuto {
        display: none !important;
    }

    /* Reset Kanvas */
    html, body {
        background: white !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        /* WAJIB: Izinkan cetak background */
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Paksa Kertas Tampil */
    #printArea, .academic-paper {
        display: block !important;
        position: relative !important; /* Wajib relative agar watermark absolute ikut */
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        background-color: transparent !important; /* Transparan agar tidak menutupi apa pun */
    }

    .citation-item {
        position: relative !important;
        z-index: 2 !important; /* Pastikan teks muncul DI ATAS watermark */
        display: block !important;
        margin-bottom: 12pt !important;
        page-break-inside: avoid;
    }

    .citation-content {
        display: block !important;
        padding-left: 1.27cm !important;
        text-indent: -1.27cm !important;
        text-align: justify !important;
        font-family: "Times New Roman", serif !important;
        font-size: 12pt !important;
        line-height: 1.5 !important;
        color: black !important;
        white-space: normal !important;
        background: transparent !important; /* Pastikan background teks transparan */
    }

    #citationList .citation-content {
        color: #000000 !important;
        font-size: 12pt !important;
        line-height: 1.5 !important;
        
        /* PENTING: Mencegah pemotongan halaman di tengah referensi */
        page-break-inside: avoid !important; 
        break-inside: avoid !important;
    }
    
    /* Pastikan link URL panjang dipecah */
    a {
        word-break: break-all !important;
        text-decoration: none !important;
        color: #000000 !important;
    }

    /* Munculkan Watermark */
    #watermark-print {
        display: block !important;
        position: fixed; top: 50%; left: 50%;
        transform: translate(-50%, -50%) rotate(-45deg);
        font-size: 60pt;
        font-weight: bold;
        color: rgba(0, 0, 0, 0.08); z-index: -1;
        z-index: 1;
    }

    .watermark-full-page {
        display: block !important;
        position: absolute !important;
        top: 0; left: 0; right: 0; bottom: 0;
        width: 100% !important;
        height: 100% !important;
        
        /* LAYERING: Di atas kertas (0), tapi di bawah teks (2) */
        z-index: 1 !important; 
        pointer-events: none !important; /* Agar teks di bawahnya tetap bisa diseleksi */
        
        /* SVG yang SUDAH DI-ENCODE (Aman untuk semua browser) */
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Ctext transform='translate(20, 100) rotate(-45)' fill='rgba(0,0,0,0.05)' font-size='20' font-family='Arial' font-weight='bold'%3Ewww.kutipin.com%3C/text%3E%3C/svg%3E") !important;
        
        background-repeat: repeat !important;
        background-position: center !important;
    }

    /* Margin Fisik Halaman */
    @page {
        size: A4;
        margin: 20mm; /* Margin default aman */
    }
}

/* ============================================================
   MATERIAL DESIGN 3 - FILTER CHIPS (FAQ)
   ============================================================
*/

.faq-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px; /* Jarak antara ikon dan teks */
    padding: 10px 20px;
    border-radius: 100px;
    background: #FFFFFF;
    border: 1px solid #DEE1E6;
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.faq-chip.active {
    background: var(--premium-gradient) !important;
    color: white !important;
    border-color: transparent !important;
    box-shadow: 0 8px 20px rgba(26, 115, 232, 0.3);
}

.faq-chip-m3 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px; /* Standard M3 Touch Target */
    padding: 0 24px;
    background-color: #FFFFFF;
    color: #444746;
    border: 1px solid #DEE1E6;
    border-radius: 100px; /* Pill shape */
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.2, 0, 0, 1);
    white-space: nowrap;
}

/* Material 3 Tonal Elevation & States */
.faq-chip-m3.active {
    /* Gunakan warna biru solid sebagai cadangan, baru kemudian gradient */
    background-color: #1a73e8 !important; 
    background: var(--premium-gradient) !important; 
    
    color: #FFFFFF !important;
    border-color: transparent !important;
    box-shadow: 0 10px 25px rgba(26, 115, 232, 0.3);
    transform: translateY(-2px);
}

.faq-chip-m3:hover:not(.active) {
    background-color: #F8F9FA;
    border-color: #1a73e8;
    color: #1a73e8;
}

/* Micro-motion untuk Ikon Check */
.faq-chip-m3 .material-symbols-rounded {
    font-size: 20px;
    transition: transform 0.3s var(--motion-spring);
}

.faq-chip-m3.active .material-symbols-rounded {
    color: #1a73e8;
    transform: scale(1.1);
}

/* Utility: Mencegah Scrollbar Liar di Mobile */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Premium Scrollbar Styling */
.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { 
    background: #DEE1E6; 
    border-radius: 20px; 
    border: 2px solid white;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #1a73e8; }

/* Icon Item Animation */
.icon-btn-m3 {
    @apply flex flex-col items-center justify-center gap-2 p-4 rounded-[24px] 
            transition-all duration-500 border-2 border-transparent hover:scale-105 active:scale-95;
}

.custom-scrollbar::-webkit-scrollbar { width: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #DEE1E6; border-radius: 10px; }