/* ======================================================
   PHONG PT BLOG — Cyber Theme (matches portfolio)
   ====================================================== */
:root {
    --ff-code: 'Fira Code', monospace;
    --ff-sans: 'Inter', sans-serif;
    --speed: 0.35s;
    --radius: 16px;
    --radius-sm: 10px;
}

.dark-theme {
    --bg: #05080f; --bg2: #0a0f1a;
    --surface: #0d1220; --surface2: #111827;
    --border: #1b2540; --border-hover: #00e5a0;
    --text1: #e4e8f1; --text2: #8892a8; --text3: #4f5a72;
    --accent: #00e5a0; --accent2: #00b8d4;
    --glow: rgba(0,229,160,0.08); --glow-strong: rgba(0,229,160,0.18);
    --shadow: 0 4px 30px rgba(0,0,0,0.5);
    --grid-color: rgba(27,37,64,0.5);
    --ring: conic-gradient(#00e5a0, #00b8d4, #7c3aed, #00e5a0);
}

.light-theme {
    --bg: #f4f6fa; --bg2: #edf0f7;
    --surface: #ffffff; --surface2: #f0f2f8;
    --border: #d4d9e6; --border-hover: #0d9668;
    --text1: #1a1e2e; --text2: #5a6178; --text3: #9098ad;
    --accent: #0d9668; --accent2: #0284a8;
    --glow: rgba(13,150,104,0.06); --glow-strong: rgba(13,150,104,0.12);
    --shadow: 0 4px 24px rgba(0,0,0,0.08);
    --grid-color: rgba(212,217,230,0.6);
    --ring: conic-gradient(#0d9668, #0284a8, #6d28d9, #0d9668);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--ff-sans); background: var(--bg); color: var(--text1);
    min-height: 100vh; display: flex; justify-content: center;
    padding: 28px 16px 60px; transition: background var(--speed), color var(--speed);
    -webkit-font-smoothing: antialiased; overflow-x: hidden; position: relative;
}

::selection { background: var(--accent); color: var(--bg); }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.bg-grid {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image: linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 60px 60px; opacity: 0.5;
}
.bg-glow {
    position: fixed; z-index: 0; pointer-events: none;
    width: 500px; height: 500px; top: -100px; right: -80px;
    background: radial-gradient(circle, var(--glow-strong) 0%, transparent 70%);
    border-radius: 50%; filter: blur(60px);
}

.shell {
    position: relative; z-index: 1; width: 100%; max-width: 960px;
    display: flex; flex-direction: column; gap: 14px;
    animation: shellIn 0.55s ease-out;
}
@keyframes shellIn { from { opacity:0; transform:translateY(18px); } to { opacity:1; transform:translateY(0); } }

/* TOPBAR */
.topbar {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 10px 20px; box-shadow: var(--shadow);
}
.topbar-left { display: flex; align-items: center; gap: 10px; font-family: var(--ff-code); font-size: 0.88rem; color: var(--accent); }
.prompt-symbol { font-weight: 700; font-size: 1rem; }
.topbar-path { color: var(--text2); }
.topbar-path .blink { animation: cursorBlink 1s step-end infinite; color: var(--accent); }
@keyframes cursorBlink { 0%,100%{opacity:1;} 50%{opacity:0;} }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.status-dot { width:8px; height:8px; border-radius:50%; background:var(--accent); box-shadow:0 0 8px var(--accent); animation:pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.4;} }
.status-text { font-family:var(--ff-code); font-size:0.75rem; color:var(--text3); text-transform:uppercase; letter-spacing:0.08em; }
.theme-btn {
    background:var(--surface2); border:1px solid var(--border); color:var(--text2);
    width:34px; height:34px; border-radius:50%; cursor:pointer;
    display:flex; align-items:center; justify-content:center; font-size:0.9rem;
    transition: all var(--speed);
}
.theme-btn:hover { border-color:var(--accent); color:var(--accent); transform:rotate(20deg); }

/* BLOG GRID */
.blog-grid {
    display: grid; grid-template-columns: 260px 1fr; gap: 14px;
}

/* TILES */
.tile {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
    transition: all var(--speed);
}
.tile:hover { border-color: var(--border-hover); }

/* SIDEBAR */
.sidebar { display: flex; flex-direction: column; gap: 14px; }

.sidebar-profile { display: flex; flex-direction: column; align-items: center; text-align: center; }
.avatar-link { text-decoration: none; display: block; }
.sidebar-avatar { position: relative; margin-bottom: 12px; }
.avatar { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; position: relative; z-index: 1; border: 3px solid var(--surface); }
.avatar-ring { position: absolute; inset: -4px; border-radius: 50%; background: var(--ring); z-index: 0; animation: ringRotate 4s linear infinite; }
@keyframes ringRotate { to { transform: rotate(360deg); } }
.avatar-link:hover .avatar { transform: scale(1.05); }
.sidebar-name { font-family: var(--ff-code); font-size: 1.15rem; font-weight: 700; }
.sidebar-sub { font-size: 0.7rem; color: var(--text3); margin: 4px 0 10px; display: flex; align-items: center; gap: 4px; }
.sidebar-sub i { font-size: 0.6rem; }
.sidebar-quote { font-size: 0.75rem; color: var(--text3); border-top: 1px dashed var(--border); padding-top: 12px; width: 100%; font-style: italic; }

/* NAV */
.tile-label { font-family: var(--ff-code); font-size: 0.82rem; color: var(--text3); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.nav-links { display: flex; flex-direction: column; gap: 6px; }
.nav-link {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px;
    background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text2); text-decoration: none; font-family: var(--ff-code); font-size: 0.82rem;
    transition: all 0.25s; position: relative; overflow: hidden;
}
.nav-link::after { content:''; position:absolute; left:0; bottom:0; width:100%; height:2px; background:var(--accent); transform:scaleX(0); transform-origin:left; transition:transform 0.3s; }
.nav-link:hover::after, .nav-link.active::after { transform:scaleX(1); }
.nav-link:hover { border-color:var(--accent); color:var(--text1); transform:translateX(3px); }
.nav-link.active { border-color:var(--accent); color:var(--text1); font-weight:600; background:var(--glow); }
.nav-link i { font-size: 0.85rem; width: 18px; text-align: center; }
.nav-link.active i { color: var(--accent); }
.nav-back { margin-top: 8px; border-style: dashed; }

/* CONTENT */
.content { display: flex; flex-direction: column; gap: 14px; min-height: 400px; }

/* LOADING */
.loading-tile { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; min-height:300px; }
.spinner { width:32px; height:32px; border:3px solid var(--border); border-top:3px solid var(--accent); border-radius:50%; animation:spin 0.8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

/* HOME WELCOME */
.welcome-tile { display: flex; flex-direction: column; gap: 16px; }
.tile-head { display:flex; justify-content:space-between; align-items:center; border-bottom:1px solid var(--border); padding-bottom:12px; margin-bottom:4px; }
.tile-head h2 { font-family:var(--ff-code); font-size:0.95rem; font-weight:600; display:flex; align-items:center; gap:8px; }
.tile-head h2 i { color:var(--accent); }
.cmd-badge { font-family:var(--ff-code); font-size:0.68rem; background:var(--surface2); padding:4px 10px; border-radius:14px; color:var(--text3); border:1px solid var(--border); }
.term-box { background:var(--surface2); border:1px solid var(--border); border-radius:var(--radius-sm); padding:16px; }
.term-prompt { font-family:var(--ff-code); font-size:0.8rem; color:var(--text3); margin-bottom:4px; }
.term-output { font-family:var(--ff-code); font-size:0.85rem; color:var(--accent); margin-bottom:10px; }
.welcome-text { font-size:0.85rem; color:var(--text2); line-height:1.65; }
.welcome-text strong { color:var(--text1); }

/* POST LIST */
.post-list { display: flex; flex-direction: column; gap: 14px; }
.post-card { display: flex; flex-direction: column; gap: 8px; }
.post-card:hover { border-color: var(--accent); }
.post-meta { display:flex; gap:12px; font-size:0.7rem; color:var(--text3); flex-wrap:wrap; font-family:var(--ff-code); }
.post-meta span { display:flex; align-items:center; gap:4px; }
.post-title-link { text-decoration:none; color:var(--text1); }
.post-title { font-size:1.1rem; font-weight:700; transition:color 0.2s; line-height:1.35; }
.post-card:hover .post-title { color:var(--accent); }
.post-summary { font-size:0.8rem; color:var(--text2); line-height:1.5; }
.post-readmore { font-family:var(--ff-code); font-size:0.78rem; color:var(--accent); text-decoration:none; display:inline-flex; align-items:center; gap:5px; font-weight:600; }
.post-readmore:hover { text-decoration:underline; gap:8px; }

/* PAGINATION */
.pagination { display:flex; justify-content:center; align-items:center; gap:6px; margin-top:8px; }
.page-btn {
    background:var(--surface2); border:1px solid var(--border); color:var(--text2);
    width:34px; height:34px; border-radius:var(--radius-sm); cursor:pointer;
    display:flex; align-items:center; justify-content:center;
    font-family:var(--ff-code); font-size:0.82rem; transition:all var(--speed);
}
.page-btn:hover:not(:disabled) { border-color:var(--accent); color:var(--text1); }
.page-btn.active { border-color:var(--accent); color:var(--accent); font-weight:700; background:var(--glow); }
.page-btn:disabled { opacity:0.3; cursor:not-allowed; }

/* FULL POST */
.full-post { display:flex; flex-direction:column; gap:16px; }
.back-btn-row { border-bottom:1px solid var(--border); padding-bottom:12px; }
.back-btn {
    display:inline-flex; align-items:center; gap:8px;
    background:var(--surface2); border:1px solid var(--border);
    padding:8px 14px; border-radius:var(--radius-sm);
    color:var(--text2); text-decoration:none; font-family:var(--ff-code);
    font-size:0.8rem; cursor:pointer; transition:all var(--speed);
}
.back-btn:hover { border-color:var(--accent); color:var(--text1); }
.post-head { display:flex; flex-direction:column; gap:8px; }
.post-head h1 { font-size:1.4rem; line-height:1.35; letter-spacing:-0.02em; }
.post-body { font-size:0.85rem; color:var(--text2); line-height:1.75; display:flex; flex-direction:column; gap:10px; }
.post-body strong { color:var(--text1); }
.post-body h3 { color:var(--text1); font-size:1rem; margin-top:10px; }
.post-body ol, .post-body ul { padding-left:18px; display:flex; flex-direction:column; gap:6px; }
.post-body pre { background:var(--surface2); border:1px solid var(--border); border-radius:var(--radius-sm); padding:14px; overflow-x:auto; font-size:0.76rem; color:var(--text1); }
.post-body code { font-family:var(--ff-code); background:var(--surface2); padding:1px 5px; border-radius:4px; font-size:0.82em; }
.post-body pre code { background:none; padding:0; }
.post-body blockquote { border-left:3px solid var(--accent); padding:10px 14px; background:var(--glow); border-radius:0 var(--radius-sm) var(--radius-sm) 0; font-style:italic; color:var(--text2); }

/* LATEST POSTS GRID (home) */
.latest-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.latest-item {
    border:1px solid var(--border); border-radius:var(--radius-sm); padding:14px;
    background:var(--surface2); display:flex; flex-direction:column; gap:5px;
    cursor:pointer; transition:all 0.3s;
}
.latest-item:hover { border-color:var(--accent); transform:translateY(-2px); box-shadow:0 0 12px var(--glow); }
.latest-top { display:flex; justify-content:space-between; font-size:0.68rem; color:var(--text3); font-family:var(--ff-code); }
.latest-tag { padding:2px 7px; border-radius:8px; background:var(--surface); border:1px solid var(--border); }
.latest-item h3 { font-size:0.85rem; font-weight:700; color:var(--text1); line-height:1.3; }
.latest-item p { font-size:0.72rem; color:var(--text2); line-height:1.4; }

/* INFO BAR */
.info-bar { padding:12px 20px; display:flex; justify-content:space-between; align-items:center; font-size:0.78rem; color:var(--text2); }
.info-bar strong { color:var(--text1); }

/* RESPONSIVE */
@media (max-width: 768px) {
    .blog-grid { grid-template-columns: 1fr; }
    .latest-grid { grid-template-columns: 1fr; }
    body { padding: 16px 10px 40px; }
}
@media (max-width: 420px) {
    .status-text { display: none; }
}
