:root {
    --bg-deep: #05070e;
    --bg-glass: rgba(16, 20, 32, 0.7);
    --border-glass: rgba(255, 255, 255, 0.08);
    --primary: #06b6d4; /* Cyan Gaming */
    --secondary: #a855f7; /* Purple Neon */
    --glow: rgba(6, 182, 212, 0.5);
    --text-main: #F8FAFC;
    --text-dim: #94A3B8;
    --success: #10B981;
    --error: #EF4444;
    --font: 'Plus Jakarta Sans', sans-serif;
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: radial-gradient(circle at top left, #12102a 0%, var(--bg-deep) 100%);
    color: var(--text-main);
    font-family: var(--font);
    min-height: 100vh;
    display: flex; justify-content: center; align-items: center;
    overflow: hidden;
}

/* === INTRO === */
.intro-screen {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: var(--bg-deep); z-index: 9999;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease, filter 0.8s ease;
}
.intro-logo {
    font-size: 50px; font-weight: 800; letter-spacing: -1px;
    opacity: 0; transform: translateY(20px) scale(0.9);
    animation: popIn 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards 0.2s;
}
.intro-d { color: #fff; }
.intro-t { background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.intro-line {
    width: 0; height: 4px; border-radius: 4px; margin-top: 10px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    animation: drawLine 1s ease forwards 0.8s;
    box-shadow: 0 0 15px var(--glow);
}

@keyframes popIn { to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes drawLine { to { width: 160px; } }

/* === MAIN LAYOUT === */
.app-main { width: 100%; max-width: 440px; padding: 20px; transition: var(--transition); z-index: 10; }
.app-main.hidden { opacity: 0; transform: translateY(40px); pointer-events: none; filter: blur(5px); }

.glass-panel {
    background: var(--bg-glass); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--border-glass); border-radius: 28px;
    padding: 35px 24px; box-shadow: 0 30px 60px rgba(0,0,0,0.6);
    position: relative; overflow: hidden;
}

.app-header { text-align: center; margin-bottom: 30px; }
.logo-icon { font-size: 42px; color: var(--primary); margin-bottom: 8px; text-shadow: 0 0 25px var(--glow); animation: float 3s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

.app-header h2 { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.highlight { color: var(--secondary); }
.app-header p { font-size: 14px; color: var(--text-dim); margin-top: 6px; }

/* === STEPS === */
.step-container { transition: var(--transition); opacity: 1; transform: translateX(0); }
.step-container.hidden { opacity: 0; transform: translateX(40px); position: absolute; top: 0; left: 0; pointer-events: none; visibility: hidden; }
.step-container.slide-left { transform: translateX(-40px); }

/* --- METHOD GRID --- */
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.method-box {
    background: rgba(255,255,255,0.02); border: 1px solid var(--border-glass);
    border-radius: 20px; padding: 24px 10px; text-align: center; cursor: pointer;
    transition: var(--transition); display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.method-box i { font-size: 34px; color: var(--text-dim); transition: 0.3s; }
.method-box span { font-size: 14px; font-weight: 600; color: var(--text-dim); transition: 0.3s; }
.method-box:hover { background: rgba(255,255,255,0.05); transform: translateY(-4px); }
.method-box.active { border-color: var(--primary); background: rgba(6, 182, 212, 0.1); box-shadow: 0 10px 25px rgba(6, 182, 212, 0.2); }
.method-box.active i, .method-box.active span { color: #fff; }

/* Mở rộng nhập Link/HAR */
.expandable-area {
    max-height: 0; opacity: 0; overflow: hidden; transition: max-height 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.5s ease, margin-top 0.4s ease;
    margin-top: 0;
}
.expandable-area.active { max-height: 250px; opacity: 1; margin-top: 24px; overflow: visible; }

textarea {
    width: 100%; background: rgba(0,0,0,0.3); border: 1px solid var(--border-glass);
    border-radius: 16px; padding: 16px; color: var(--text-main); font-family: monospace; font-size: 13px;
    resize: none; outline: none; transition: 0.3s; line-height: 1.5;
}
textarea:focus { border-color: var(--primary); background: rgba(0,0,0,0.5); box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15); }

.har-file-display {
    background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 16px; padding: 16px; display: flex; align-items: center; gap: 10px; color: var(--success); font-weight: 600;
}

/* === STEP 2: CONFIG === */
.step-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.btn-icon { background: rgba(255,255,255,0.05); border: 1px solid var(--border-glass); color: #fff; width: 42px; height: 42px; border-radius: 12px; cursor: pointer; font-size: 20px; transition: 0.3s; display: grid; place-items: center; }
.btn-icon:hover { background: rgba(255,255,255,0.15); transform: scale(1.05); }
.step-header h3 { font-size: 18px; font-weight: 700; }

.drop-zone {
    border: 2px dashed var(--border-glass); border-radius: 20px; height: 240px;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    background: rgba(0,0,0,0.25); cursor: pointer; transition: 0.3s; position: relative; overflow: hidden;
}
.drop-zone:hover { border-color: var(--primary); background: rgba(6, 182, 212, 0.08); }
.drop-zone i { font-size: 50px; color: var(--primary); margin-bottom: 12px; transition: 0.3s; }
.drop-zone:hover i { transform: scale(1.1); }
.drop-zone p { font-weight: 600; font-size: 15px; }
.drop-zone span { font-size: 12px; color: var(--text-dim); margin-top: 6px; }
#imagePreview { width: 100%; height: 100%; object-fit: contain; position: absolute; z-index: 2; background: var(--bg-deep); }

.visibility-tabs { display: flex; background: rgba(0,0,0,0.4); border-radius: 16px; padding: 6px; margin-top: 20px; }
.tab-label { flex: 1; display: flex; justify-content: center; align-items: center; gap: 8px; padding: 12px; border-radius: 12px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-dim); transition: 0.3s; }
.tab-label.active { background: var(--bg-glass); color: #fff; box-shadow: 0 4px 15px rgba(0,0,0,0.3); border: 1px solid var(--border-glass); }

/* === BUTTONS === */
.action-wrap { margin-top: 24px; }
.btn-primary, .btn-glow {
    width: 100%; height: 56px; border: none; border-radius: 16px;
    display: flex; justify-content: center; align-items: center; gap: 10px;
    font-family: var(--font); font-size: 16px; font-weight: 700; color: #fff;
    cursor: pointer; transition: 0.3s;
    position: relative; overflow: hidden;
}
.btn-primary { background: rgba(255,255,255,0.08); border: 1px solid var(--border-glass); }
.btn-primary:hover:not(.disabled) { background: rgba(255,255,255,0.15); }
.btn-glow { background: linear-gradient(135deg, var(--primary), var(--secondary)); box-shadow: 0 10px 30px rgba(6, 182, 212, 0.4); }
.btn-glow:hover:not(.disabled) { transform: translateY(-3px); box-shadow: 0 15px 40px rgba(168, 85, 247, 0.5); }
.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; filter: grayscale(0.5); }

/* === MODAL & DONATE === */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(5, 7, 14, 0.85); backdrop-filter: blur(12px); display: flex; justify-content: center; align-items: center; z-index: 100; transition: var(--transition); opacity: 1; }
.modal-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.modal-glass { background: var(--bg-glass); border: 1px solid var(--border-glass); border-radius: 28px; width: 90%; max-width: 380px; padding: 40px 24px; text-align: center; position: relative; transform: scale(1); transition: 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); box-shadow: 0 30px 60px rgba(0,0,0,0.8); }
.modal-overlay.hidden .modal-glass { transform: scale(0.9); }
.modal-close { position: absolute; top: 16px; right: 16px; }

.modal-state { display: none; flex-direction: column; align-items: center; animation: fadeIn 0.5s ease; }
.modal-state.active { display: flex; }
.modal-state h3 { font-size: 24px; margin-bottom: 10px; font-weight: 800; }
.modal-state p { font-size: 14px; color: var(--text-dim); line-height: 1.6; }

/* Loader */
.loader { display: flex; gap: 8px; margin-bottom: 24px; }
.loader .circle { width: 16px; height: 16px; border-radius: 50%; background: var(--primary); animation: bounce 0.5s alternate infinite ease; box-shadow: 0 0 15px var(--primary); }
.loader .circle:nth-child(2) { animation-delay: 0.16s; background: var(--secondary); box-shadow: 0 0 15px var(--secondary); }
.loader .circle:nth-child(3) { animation-delay: 0.32s; background: #fff; box-shadow: 0 0 15px #fff; }
@keyframes bounce { from { transform: scaleX(1.25); } to { transform: translateY(-20px) scaleX(1); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.icon-pulse { font-size: 68px; margin-bottom: 20px; animation: pulse 2s infinite; }
.icon-pulse.success { color: var(--success); text-shadow: 0 0 30px rgba(16, 185, 129, 0.5); }
.icon-pulse.error { color: var(--error); text-shadow: 0 0 30px rgba(239, 68, 68, 0.5); }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }

.badge-id { margin-top: 20px; padding: 10px 24px; background: rgba(16, 185, 129, 0.1); border: 1px dashed var(--success); border-radius: 12px; color: var(--success); font-weight: 700; letter-spacing: 1px; font-size: 16px; }

/* Khu vực Donate */
.donate-section { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border-glass); width: 100%; display: flex; flex-direction: column; align-items: center; }
.donate-text { font-size: 14px !important; font-weight: 700; color: var(--primary); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px; }
.qr-box { width: 140px; height: 140px; border-radius: 14px; overflow: hidden; border: 2px solid var(--primary); box-shadow: 0 0 20px rgba(6, 182, 212, 0.3); background: #fff; padding: 4px; }
.qr-box img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }

#fireworksCanvas { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 1000; }