/* ==========================================================================
   1. CORE CONFIGURATION & BASE STYLES
   ========================================================================== */
:root {
    --bg: #050505;
    --text: #00ff41; 
    --accent: #ff003c; 
    --font-mono: 'Courier New', Courier, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-mono);
    line-height: 1.6;
    cursor: crosshair; /* Default cursor */
    overflow-x: hidden;
}

/* Language Visibility Logic */
body.lang-vi .content-en { display: none; }
body.lang-en .content-vi { display: none; }

/* ==========================================================================
   2. GLOBAL VISUAL EFFECTS (Overlays & Mouse)
   ========================================================================== */

/* Mouse Glow Effect */
#cursor-glow {
    position: fixed; top: 0; left: 0;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(0, 255, 65, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9998;
    mix-blend-mode: screen;
}

/* CRT Vignette (Dark corners) */
.crt-vignette {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, rgba(0,0,0,0) 60%, rgba(0,0,0,0.8) 100%);
    z-index: 9990; pointer-events: none;
}

/* Scanlines Effect */
.scanlines {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 3px 100%;
    z-index: 9999; pointer-events: none;
}

/* ==========================================================================
   3. BOOT LOADER SEQUENCE
   ========================================================================== */
#boot-loader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg); z-index: 100000;
    display: flex; justify-content: center; align-items: center; padding: 20px;
}
.boot-container { width: 100%; max-width: 600px; }
.boot-header { border-bottom: 1px solid var(--text); color: var(--accent); margin-bottom: 15px; font-weight: bold; }
.boot-log { height: 120px; overflow: hidden; font-size: 0.8rem; display: flex; flex-direction: column; justify-content: flex-end; margin-bottom: 20px; }
.boot-progress-bar { height: 15px; border: 1px solid var(--text); padding: 2px; margin: 10px 0; }
#boot-fill { height: 100%; width: 0%; background: var(--text); }
.loaded-complete { opacity: 0; pointer-events: none; transition: 0.8s ease; }

/* ==========================================================================
   4. LAYOUT & NAVIGATION
   ========================================================================== */
.system-nav {
    display: flex; justify-content: space-between; padding: 20px;
    border-bottom: 2px solid var(--text); position: sticky; top: 0; background: var(--bg); z-index: 100;
}
.cmd-btn { background: var(--text); color: var(--bg); border: none; padding: 5px 12px; cursor: pointer; font-weight: bold; font-family: var(--font-mono); }
.cmd-btn:hover { background: var(--accent); color: #fff; }

.terminal-container { max-width: 1100px; margin: 0 auto; padding: 60px 20px; }
.console-block { margin-bottom: 80px; }
.cmd-line { color: var(--accent); font-weight: bold; margin-bottom: 20px; }

.system-footer { text-align: center; padding: 40px; border-top: 1px solid #222; font-size: 0.8rem; opacity: 0.6; }

/* Scroll Reveal Animation */
.hidden-section { opacity: 0; transform: translateY(30px); transition: all 0.8s ease-out; }
.show-section { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   5. TYPOGRAPHY & TEXT EFFECTS
   ========================================================================== */
h1 { font-size: clamp(1.8rem, 6vw, 3.5rem); position: relative; text-shadow: 2px 2px 0px rgba(0, 255, 65, 0.3); }

/* Glitch Effect */
.glitch-text::before, .glitch-text::after {
    content: attr(data-text); position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0.8;
}
.glitch-text:hover::before { animation: glitch 0.3s cubic-bezier(.25,.46,.45,.94) both infinite; color: var(--accent); z-index: -1; }

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-3px, 3px); }
    40% { transform: translate(-3px, -3px); }
    60% { transform: translate(3px, 3px); }
    80% { transform: translate(3px, -3px); }
    100% { transform: translate(0); }
}

/* Slogan & Cursor */
.slogan-box {
    font-size: 1.2rem; min-height: 1.6em; color: #fff; opacity: 0.9;
    margin-bottom: 20px; display: flex; align-items: center;
}
#slogan-text { white-space: pre-wrap; }

.cursor { display: inline-block; color: var(--accent); animation: blink 1s step-end infinite; margin-left: 5px; font-weight: bold; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ==========================================================================
   6. HERO SECTION & AVATAR
   ========================================================================== */
.hero-layout {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-top: 15px; width: 100%;
}

.hero-avatar-wrapper { flex-shrink: 0; margin-top: 5px; }

.avatar-frame {
    width: 200px; height: 200px;
    border: 1px solid var(--text); padding: 2px;
    position: relative; overflow: hidden;
    background: rgba(0, 255, 65, 0.05);
}

.avatar-img {
    width: 100%; height: 100%; object-fit: cover;
    filter: grayscale(100%) sepia(100%) hue-rotate(70deg) saturate(400%) contrast(1.1);
    mix-blend-mode: screen;
}

.avatar-scanline {
    position: absolute; top: 0; left: 0; width: 100%; height: 2px;
    background: var(--text); box-shadow: 0 0 5px var(--text);
    animation: scanFace 2.5s linear infinite;
}

.avatar-caption { margin-top: 4px; font-size: 0.55rem; color: var(--accent); opacity: 0.8; }

@keyframes scanFace {
    0% { top: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

@media (max-width: 768px) {
    .hero-layout { flex-direction: row; align-items: flex-start; text-align: left; }
    .avatar-frame { width: 70px; height: 70px; }
}

/* ==========================================================================
   7. STANDARD COMPONENTS (Skills, Projects, Contact)
   ========================================================================== */
/* Skills */
.brutal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); border: 1px solid var(--text); }
.skill-box { padding: 25px; border: 1px solid var(--text); transition: 0.3s; position: relative; overflow: hidden; }
.skill-box:hover { background: var(--text); color: var(--bg); }
.skill-box.highlight { border: 2px solid var(--accent); color: var(--accent); }
.skill-box::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}
.skill-box:hover::before { left: 100%; }
.code-num { font-size: 0.7rem; display: block; margin-bottom: 5px; opacity: 0.7; }

/* Projects */
.project-brutal-card { border: 2px solid var(--text); transition: transform 0.3s; }
.project-brutal-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0, 255, 65, 0.1); }
.project-header { background: var(--text); color: var(--bg); padding: 8px 15px; font-weight: bold; }
.project-body { display: flex; flex-wrap: wrap; }
.project-img-wrapper { flex: 1 1 400px; border-right: 1px solid var(--text); filter: grayscale(1); transition: 0.5s; }
.project-img-wrapper:hover { filter: grayscale(0); }
.project-img-wrapper img { width: 100%; height: auto; display: block; }
.project-desc { flex: 1 1 300px; padding: 25px; }
.launch-btn { 
    display: block; text-align: center; padding: 15px; border: 2px solid var(--text); 
    color: var(--text); text-decoration: none; margin-top: 20px; 
    font-weight: bold; transition: 0.2s; 
}
.launch-btn:hover { background: var(--text); color: var(--bg); box-shadow: 0 0 15px var(--text); }

@media (max-width: 768px) {
    .project-img-wrapper { border-right: none; border-bottom: 1px solid var(--text); }
}

/* Contact */
.contact-terminal { border: 1px dashed var(--text); padding: 25px; background: rgba(0,255,65,0.03); }
.contact-row { margin-bottom: 10px; display: flex; gap: 15px; }
.label { color: var(--accent); font-weight: bold; }
.value { color: var(--text); text-decoration: none; position: relative; }
.value::after { content: '_'; animation: blink 1s infinite; opacity: 0; }
.contact-row:hover .value::after { opacity: 1; }

/* ==========================================================================
   8. PAGE: REPORT & GRADES
   ========================================================================== */
.report-container {
    border: 1px solid var(--text); padding: 10px; font-family: var(--font-mono);
    margin-bottom: 40px; background: rgba(0, 255, 65, 0.02);
}

.report-header {
    display: grid; grid-template-columns: 2fr 1fr 2fr;
    border-bottom: 2px solid var(--text); padding-bottom: 10px; margin-bottom: 10px;
    font-weight: bold; color: var(--accent);
}

.report-row {
    display: grid; grid-template-columns: 2fr 1fr 2fr;
    padding: 8px 0; border-bottom: 1px dashed rgba(0, 255, 65, 0.3);
    transition: 0.2s; cursor: pointer; user-select: none; position: relative;
}

.report-row:hover { background: rgba(0, 255, 65, 0.1); padding-left: 10px; }
.report-row.active { background: rgba(0, 255, 65, 0.15); color: #fff; }

.text-highlight { color: #fff; font-weight: bold; text-shadow: 0 0 5px var(--text); }

/* Detail Accordion */
.detail-row {
    max-height: 0; overflow: hidden;
    transition: max-height 0.3s ease-out, background 0.3s;
    background: rgba(0, 0, 0, 0.3); border-bottom: 1px solid rgba(0, 255, 65, 0.1);
}
.detail-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px; padding: 15px 20px; font-size: 0.85rem; color: #bbb;
}
.d-item { border-left: 2px solid var(--text); padding-left: 8px; }
.d-item.highlight { color: var(--accent); border-left: 2px solid var(--accent); font-weight: bold; }

.expand-icon { display: inline-block; width: 20px; margin-right: 5px; transition: transform 0.3s; color: var(--accent); }
.report-row.active .expand-icon { transform: rotate(90deg); }

.note-box { border: 1px solid var(--accent); padding: 20px; color: #fff; min-height: 100px; background: rgba(255, 0, 60, 0.05); }

@media (max-width: 600px) {
    .report-header, .report-row { grid-template-columns: 1fr 1fr; font-size: 0.8rem; }
    .report-header .col:nth-child(3), .report-row .col:nth-child(3) { display: none; }
}

/* ==========================================================================
   9. PAGE: LOGS / ZALO APP
   ========================================================================== */
.log-container {
    border: 1px solid var(--text); background: rgba(0, 0, 0, 0.5);
    font-family: var(--font-mono); font-size: 0.85rem;
}
.log-header {
    display: grid; grid-template-columns: 120px 100px 1fr;
    background: var(--text); color: var(--bg);
    padding: 8px 15px; font-weight: bold; border-bottom: 1px solid var(--text);
}
.log-entry {
    display: grid; grid-template-columns: 120px 100px 1fr;
    padding: 12px 15px; border-bottom: 1px dashed rgba(0, 255, 65, 0.3); transition: 0.2s;
}
.log-entry:hover { background: rgba(0, 255, 65, 0.05); }
.log-ver { color: var(--accent); font-weight: bold; }
.tag-new { background: var(--accent); color: #fff; padding: 2px 6px; font-size: 0.7rem; margin-right: 8px; border-radius: 2px; }

@media (max-width: 600px) {
    .log-header { display: none; }
    .log-entry { grid-template-columns: 1fr; gap: 5px; padding: 15px; border-bottom: 1px solid var(--text); }
    .log-date { opacity: 0.7; font-size: 0.75rem; }
}

/* ==========================================================================
   10. SPECIAL FEATURES (God Mode, Matrix, Stats)
   ========================================================================== */

/* System Stats in Footer */
.sys-info-bar { margin-bottom: 10px; font-weight: bold; color: var(--accent); text-shadow: 0 0 5px var(--accent); }
.separator { margin: 0 10px; opacity: 0.5; }
.status-blink { animation: blink 1s step-end infinite; }

/* Matrix Background Canvas */
#matrix-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; opacity: 0; transition: opacity 1s ease; pointer-events: none;
}

/* GOD MODE ACTIVATED STATE */
body.god-mode {
    --text: #00ffff;   /* Cyan */
    --accent: #ff00ff; /* Magenta */
    background-color: #0a000a;
}

/* Screen Shake */
body.god-mode .terminal-container { animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Reveal Matrix Rain */
body.god-mode #matrix-bg { opacity: 0.15; }

/* Reveal Secret Section */
.god-only-section { display: none; }
body.god-mode .god-only-section {
    display: block;
    animation: glitchReveal 0.5s ease forwards;
}

@keyframes glitchReveal {
    0% { transform: scaleY(0); opacity: 0; }
    50% { transform: scaleY(1.2); opacity: 1; }
    100% { transform: scaleY(1); opacity: 1; }

}
/* ==========================================================================
   11. PROJECT PLACEHOLDER STYLES
   ========================================================================== */

/* Warning Dot color (Orange/Yellow) */
.status-dot.warning {
    background-color: #ff9900;
    box-shadow: 0 0 8px #ff9900;
    animation: blink 0.5s infinite;
}

/* Disabled Button Style */
.launch-btn.disabled-btn {
    border-color: #555;
    color: #555;
    cursor: not-allowed;
    background: rgba(0,0,0,0.5);
    box-shadow: none;
}
.launch-btn.disabled-btn:hover {
    background: rgba(0,0,0,0.5);
    color: #555;
    box-shadow: none;
    transform: none;
}

/* WIP Card Hover Effect - different from normal cards */
.project-brutal-card.wip-card:hover {
    border-color: #ff9900;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 153, 0, 0.1);
}

/* Progress Bar Pulse Animation */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* ==========================================================================
   FILE EXPLORER STYLES
   ========================================================================== */
.window-frame {
    border: 2px solid var(--text);
    background: rgba(0, 20, 0, 0.9);
    box-shadow: 10px 10px 0px rgba(0, 255, 65, 0.1);
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    height: 500px; /* Fixed height for the window look */
}

/* Header */
.window-header {
    background: var(--text);
    color: var(--bg);
    padding: 5px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    border-bottom: 2px solid var(--text);
}

.win-controls { display: flex; gap: 5px; }
.win-btn { cursor: pointer; padding: 0 5px; }
.win-btn.close:hover { background: var(--accent); color: white; }

/* Navigation Bar */
.window-bar {
    display: flex;
    padding: 8px;
    border-bottom: 1px solid var(--text);
    gap: 10px;
}

.nav-btn {
    background: transparent;
    border: 1px solid var(--text);
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
}
.nav-btn:hover { background: var(--text); color: var(--bg); }

.address-input {
    flex-grow: 1;
    border: 1px solid var(--text);
    padding: 2px 8px;
    font-size: 0.9rem;
    background: rgba(0,0,0,0.5);
}

/* Body Layout */
.window-body {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 150px;
    border-right: 1px solid var(--text);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.sidebar-item {
    padding: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0.7;
}
.sidebar-item:hover, .sidebar-item.active {
    background: rgba(0, 255, 65, 0.2);
    opacity: 1;
}

/* File Grid Area */
.file-grid {
    flex-grow: 1;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    grid-auto-rows: 120px;
    gap: 15px;
    overflow-y: auto;
}

/* Icons (Folders & Files) */
.icon-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    text-align: center;
    padding: 10px;
    border: 1px solid transparent;
}

.icon-container:hover {
    border: 1px dashed var(--text);
    background: rgba(0, 255, 65, 0.1);
}

.icon-img {
    font-size: 2.5rem;
    margin-bottom: 10px;
    user-select: none;
}

.icon-label {
    font-size: 0.8rem;
    word-break: break-word;
    line-height: 1.2;
}

.icon-tag {
    font-size: 0.6rem;
    color: var(--accent);
    margin-top: 2px;
}

/* Footer */
.window-footer {
    border-top: 1px solid var(--text);
    padding: 2px 10px;
    font-size: 0.7rem;
    background: var(--text);
    color: var(--bg);
}

/* Scrollbar customization for webkit */
.file-grid::-webkit-scrollbar { width: 8px; }
.file-grid::-webkit-scrollbar-track { background: #000; }
.file-grid::-webkit-scrollbar-thumb { background: var(--text); }
