/* H@CKERBOY Blog - Clean CSS Structure */

/* ===== BASE STYLES ===== */
html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(45deg, #f5f5f5, #e0e0e0, #f0f0f0, #e5e5e5);
  background-size: 400% 400%;
  animation: backgroundShift 15s ease-in-out infinite;
  color: #333;
  line-height: 1.5;
  overflow-x: hidden;
  transition: transform 0.2s ease;
}

#background-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ===== KEYFRAMES ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes staggerFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes glitch {
  0% { text-shadow: 2px 2px red, -2px -2px blue; }
  20% { text-shadow: -2px 2px lime, 2px -2px purple; }
  40% { text-shadow: 2px -2px orange, -2px 2px cyan; }
  60% { text-shadow: -1px -1px white, 1px 1px gray; }
  80% { text-shadow: 3px 0 red, -3px 0 blue; }
  100% { text-shadow: 0 0 2px #0ff; }
}

@keyframes slideIn {
  0% { transform: translateY(40px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

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

main {
  max-width: 100%;
  margin: 0 auto;
  padding: 20px;
}

section {
  padding: 60px 0;
  margin: 0;
  margin-bottom: 20px;
  line-height: 1.6;
}

.category-section:nth-child(odd) {
  background-color: #f5f5f5;
}

.category-section:nth-child(even) {
  background-color: #e0e0e0;
}

.posts {
  margin: 60px 0;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 40px;
  margin-bottom: 60px;
}

.category {
  margin-bottom: 60px;
}

/* ===== HEADER ===== */
header {
  background: white;
  backdrop-filter: blur(15px);
  color: #333;
  padding: 15px 0;
  text-align: center;
  border-bottom: 2px solid #ddd;
  position: sticky;
  top: 0;
  z-index: 100;
  animation: fadeIn 1s ease-out;
  transform: translateY(0);
  transition: transform 0.3s ease;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: 2px;
  animation: fadeInUp 1s ease-out 0.2s both;
  text-shadow: 0 0 10px #00ffff;
}

header nav ul {
  list-style: none;
  padding: 10px 0 0 0;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

header nav ul li a {
  color: #00ffff;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 10px 20px;
  border-radius: 25px;
  border: 1px solid #00ffff;
  position: relative;
  overflow: hidden;
}

header nav ul li a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(244, 246, 246, 0.692), transparent);
  transition: left 0.5s;
}

header nav ul li a:hover {
  color: #000;
  background-color: #00ffff;
  box-shadow: 0 0 15px #00ffff;
  transform: translateY(-2px);
}

header nav ul li a:hover::before {
  left: 100%;
}

/* Compact header on post pages */
body[data-post-slug] header {
  padding: 4px 0;
  border-bottom-width: 1px;
}

body[data-post-slug] header .container {
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

body[data-post-slug] header h1 {
  font-size: 0.85rem !important;
  font-weight: 500;
  margin: 4px 0;
}

body[data-post-slug] header nav ul li a {
  padding: 6px 10px;
  font-size: 0.9rem;
}

body[data-post-slug] header .btn-back {
  padding: 4px 12px;
  font-size: 0.9rem;
  margin-right: 50px;
  margin-top: 10px;
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: white;
  position: relative;
  padding: 40px 20px;
  margin: 0;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 80%, rgba(0, 255, 255, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(255, 0, 255, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 40% 40%, rgba(255, 255, 0, 0.1) 0%, transparent 50%);
  animation: pulse 4s ease-in-out infinite alternate;
}

.hero .container {
  max-width: 900px;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 5rem;
  font-weight: 900;
  margin-bottom: 30px;
  letter-spacing: -0.05em;
  background: linear-gradient(45deg, #00ffff, #ff00ff, #ffff00, #00ffff);
  background-size: 400% 400%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease-in-out infinite, fadeInUp 1s ease-out;
  text-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
}

.hero p {
  font-size: 1.8rem;
  color: #333;
  max-width: 700px;
  margin: 0 auto 40px;
  line-height: 1.4;
  animation: fadeInUp 1s ease-out 0.3s both;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes pulse {
  0% { opacity: 0.3; }
  100% { opacity: 0.7; }
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3 {
  font-family: 'Orbitron', sans-serif !important;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 40px;
  text-align: center;
  border-bottom: 2px solid #007aff;
  padding-bottom: 20px;
}

section h2 {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 40px;
  color: #000;
  text-align: center;
}

section h3 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #ccc;
  margin-bottom: 30px;
  padding-bottom: 10px;
  border-bottom: 2px solid #007aff;
}

section h2:not(.hero h1) {
  font-size: 2rem;
  margin-bottom: 20px;
  text-align: left;
}

section h3:not(.category h3) {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: #424245;
}

section p {
  font-size: 1rem;
  line-height: 1.6;
  color: #424245;
}

ul {
  background: #f5f5f7;
  padding: 20px;
  border-radius: 12px;
  margin-left: 0;
  list-style-position: inside;
}

ul li {
  margin-bottom: 10px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  margin-top: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ===== COMPONENTS ===== */
article {
  background: #fff;
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  opacity: 0;
  animation: staggerFadeIn 0.6s ease-out forwards;
  transform: translateY(20px);
  border: 1px solid #d2d2d7;
}

article:nth-child(1) { animation-delay: 0.1s; }
article:nth-child(2) { animation-delay: 0.2s; }
article:nth-child(3) { animation-delay: 0.3s; }
article:nth-child(4) { animation-delay: 0.4s; }
article:nth-child(5) { animation-delay: 0.5s; }
article:nth-child(6) { animation-delay: 0.6s; }

article:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  transform: translateY(-8px);
}

article h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: #1d1d1f;
}

article p.meta {
  font-size: 0.875rem;
  color: #86868b;
  margin-bottom: 16px;
}

article p.content {
  font-size: 1rem;
  color: #424245;
  line-height: 1.5;
}

article a.read-more {
  display: inline-block;
  margin-top: 16px;
  color: #007aff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

article a.read-more:hover {
  color: #0056cc;
}

.btn-back {
  display: inline-block;
  background-color: #007aff;
  color: #fff;
  padding: 12px 24px;
  border-radius: 25px;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 40px;
  transition: background-color 0.2s ease;
}

.btn-back:hover {
  background-color: #0056cc;
}

/* ===== FOOTER ===== */
footer {
  background-color: #f5f5f7;
  color: #424245;
  padding: 60px 0 40px;
  border-top: 1px solid #d2d2d7;
  margin-top: 60px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  gap: 40px;
}

.footer-brand {
  flex: 1;
}

.footer-brand h3 {
  color: #1d1d1f;
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: #424245;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #007aff;
}

.social-links {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.social-link {
  color: #007aff;
  text-decoration: none;
  font-size: 1.25rem;
  transition: color 0.2s ease;
}

.social-link:hover {
  color: #0056cc;
}

.footer-bottom {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #d2d2d7;
  font-size: 0.875rem;
  color: #86868b;
}

/* ===== NAVIGATION ===== */
.nav-toggle-label {
  display: none;
  position: absolute;
  right: 18px;
  top: 10px;
  width: 30px;
  height: 30px;
  border-radius: 60%;
  background: #bfb5b5;
  border: 2px solid rgba(29, 29, 31, 0.08);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.nav-toggle-label span {
  display: block;
  width: 22px;
  height: 2px;
  background: #1d1d1f;
  position: relative;
}

.nav-toggle-label span:before,
.nav-toggle-label span:after {
  content: '';
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: #1d1d1f;
  transition: transform 0.25s;
}

.nav-toggle-label span:before {
  top: -7px;
}

.nav-toggle-label span:after {
  top: 7px;
}

#nav-toggle {
  display: none;
}

/* ===== DARK MODE ===== */
:root {
  --bg-color: #121212;
  --text-color: #e0e0e0;
  --accent-color: #00ff88;
  --secondary-bg: #1e1e1e;
  --border-color: #333;
}

body.dark-theme {
  background-color: var(--bg-color);
  color: var(--text-color);
}

.dark-theme header {
  background-color: var(--secondary-bg);
  color: var(--text-color);
  border-bottom-color: var(--border-color);
}

.dark-theme header nav ul li a {
  color: var(--text-color);
}

.dark-theme header nav ul li a:hover {
  background-color: rgba(0, 255, 136, 0.1);
  color: var(--accent-color);
}

.dark-theme .hero {
  background-color: var(--bg-color);
}

.dark-theme .hero h1,
.dark-theme .hero p {
  color: var(--text-color);
}

.dark-theme section {
  background-color: var(--bg-color);
}

.dark-theme .category-section:nth-child(even) {
  background-color: var(--secondary-bg);
}

.dark-theme article {
  background-color: var(--secondary-bg);
  border-color: var(--border-color);
}

.dark-theme article h2,
.dark-theme article p {
  color: var(--text-color);
}

.dark-theme article a.read-more {
  color: var(--accent-color);
}

.dark-theme article a.read-more:hover {
  color: #00cc77;
}

.dark-theme footer {
  background-color: var(--secondary-bg);
  color: var(--text-color);
  border-top-color: var(--border-color);
}

.dark-theme .footer-bottom {
  border-top-color: var(--border-color);
}

.dark-mode-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--accent-color);
  color: #000;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 24px;
  cursor: pointer;
  z-index: 1001;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s ease;
}

.dark-mode-toggle:hover {
  background-color: #00cc77;
}

.dark-theme .social-link {
  color: var(--accent-color);
}

.dark-theme .social-link:hover {
  color: #00cc77;
}

.dark-theme .btn-back {
  background-color: var(--accent-color);
  color: #000;
}

.dark-theme .btn-back:hover {
  background-color: #00cc77;
}

.dark-theme code {
  background-color: var(--secondary-bg);
  color: var(--accent-color);
  padding: 2px 4px;
  border-radius: 4px;
}

/* ===== CYBER THEME ===== */
:root {
  --primary: #007aff;
  --accent: #ff5722;
  --bg: #ffffff;
  --light: #1d1d1f;
}

.neon {
  color: var(--primary);
}

.glow-border {
  border: 2px solid #00ffff;
  box-shadow: 0 0 10px #00ffff;
}

.cyber-btn {
  background: none;
  border: 2px solid #00ffff;
  color: #00ffff;
  padding: 10px 20px;
  font-family: 'Orbitron';
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.cyber-btn:hover {
  background: #00ffff;
  color: #000;
  box-shadow: 0 0 10px #0ff;
}

/* ===== ASSISTANT WIDGET ===== */
.assistant-container {
  max-width: 600px;
  margin: 2rem auto;
  background-color: #969090;
  border: 2px solid rgb(240, 243, 243);
  border-radius: 10px;
  padding: 1rem;
  font-family: 'Courier New', monospace;
  color: #000000;
}

.assistant-chat {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 1rem;
  padding-right: 0.5rem;
}

.msg {
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  border-radius: 5px;
}

.msg.bot {
  background-color: #022c22;
  color: #191a19;
}

.msg.user {
  background-color: #1f1f1f;
  color: #ffffff;
  text-align: right;
}

.assistant-inputs {
  display: flex;
  gap: 0.5rem;
}

.assistant-input {
  flex-grow: 1;
  padding: 0.5rem;
  background-color: #1a1a1a;
  border: 1px solid #0ff;
  color: white;
  border-radius: 5px;
}

.assistant-btn {
  padding: 0.5rem 1rem;
  background-color: #00ffff;
  color: #000;
  font-weight: bold;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.assistant-btn:hover {
  background-color: #00dddd;
}

#matrix-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: black;
}

#assistant-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #00ffff;
  color: black;
  padding: 10px 14px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 0 10px #0ff;
  transition: transform 0.2s ease;
}

#assistant-toggle:hover {
  transform: scale(1.1);
}

#assistant-widget {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 350px;
  max-height: 500px;
  background: #0f0f0f;
  border: 2px solid #0ff;
  border-radius: 10px;
  overflow: hidden;
  z-index: 999;
  box-shadow: 0 0 20px #00ffff55;
}

/* ===== DECORATIVE EFFECTS ===== */
header {
  text-align: center;
  padding: 12px 0;
  position: relative;
  transform: translateY(0) !important;
  transition: transform 0.3s !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  background-color: inherit !important;
}

header:hover {
  transform: translateY(0) !important;
}

.header-content {
  animation: fadeIn 2s ease-in;
}

.gang {
  font-size: 3rem;
  color: #fff;
  text-shadow: 2px 2px 10px rgba(0, 255, 255, 0.8);
  animation: glitch 1s infinite;
}

.social-icons {
  margin-top: 20px;
  animation: slideIn 1.5s ease-in-out;
}

.social-icon {
  font-size: 2rem;
  margin: 0 15px;
  color: white;
  transition: color 0.3s, transform 0.3s;
}

.social-icon:hover {
  color: var(--accent);
  transform: scale(1.2);
}

.fade-in {
  opacity: 0;
  animation: fadeInUp 1s ease forwards;
}

.zoom-in {
  opacity: 0;
  animation: zoomIn 1s ease forwards;
}

/* ===== MEDIA QUERIES ===== */
@media (max-width: 900px) {
  header {
    padding: 12px 16px;
  }
  header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  header h1 {
    font-size: 1rem;
  }
  .nav-toggle-label {
    display: flex;
  }
  header nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 64px;
    background: rgba(255, 255, 255, 0.98);
    padding: 12px 16px;
    border-bottom: 1px solid #e6e6ea;
    display: none;
  }
  header nav ul {
    flex-direction: column;
    gap: 8px;
    align-items: center;
  }
  header nav ul li a {
    padding: 10px 14px;
  }
  #nav-toggle:checked ~ nav {
    display: block;
  }
  #nav-toggle:checked + .nav-toggle-label span {
    background: transparent;
  }
  #nav-toggle:checked + .nav-toggle-label span:before {
    transform: translateY(7px) rotate(45deg);
  }
  #nav-toggle:checked + .nav-toggle-label span:after {
    transform: translateY(-7px) rotate(-45deg);
  }
  body[data-post-slug] header nav {
    top: 48px;
    left: 8px;
    right: 8px;
    max-width: calc(100% - 16px);
    margin: 0 auto;
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  }
  body[data-post-slug] header nav ul {
    gap: 0.5rem;
    align-items: stretch;
  }
  body[data-post-slug] header nav ul li a {
    display: block;
    padding: 8px 10px;
    font-size: 0.95rem;
    border-radius: 6px;
    text-align: left;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  header {
    padding: 8px 0;
  }
  header h1 {
    font-size: 1.4rem;
  }
  header nav ul {
    flex-direction: column;
    gap: 0.75rem;
  }
  .hero {
    min-height: 80vh;
    padding: 20px 0;
  }
  .hero h1 {
    font-size: 3rem;
  }
  .hero p {
    font-size: 1.25rem;
  }
  .posts-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  section {
    padding: 60px 0;
  }
  section h2 {
    font-size: 2rem;
  }
  .dark-mode-toggle {
    bottom: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  .footer-content {
    flex-direction: column;
    gap: 30px;
    text-align: center;
  }
  .social-links {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2.5rem;
  }
  .hero p {
    font-size: 1.05rem;
  }
  .posts-grid {
    gap: 24px;
  }
  article {
    padding: 24px;
  }
}

/* ===== UTILITY CLASSES ===== */
.alert-section {
  margin-top: 60px;
  text-align: center;
}

.att {
  font-size: 2rem;
  color: red;
  animation: blink 1s infinite;
  background-color: #000;
  padding: 10px;
  border-radius: 10px;
}

/* ===== BLOG POSTS ===== */
.blog-posts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: auto;
}

.blog-post {
  background: #1a1a1a;
  padding: 25px;
  border-radius: 20px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  transition: transform 0.3s, box-shadow 0.3s;
}

.blog-post:hover {
  transform: translateY(-10px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.8);
}

.post-title {
  font-size: 2rem;
  margin-bottom: 15px;
  color: var(--primary);
  transition: color 0.3s;
}

.blog-post:hover .post-title {
  color: #0ff;
  text-shadow: 0 0 10px #0ff;
}

.post-meta {
  font-size: 0.9rem;
  color: #bbb;
  margin-bottom: 15px;
}

.post-content {
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.read-more {
  text-decoration: none;
  color: var(--accent);
  font-weight: bold;
  transition: color 0.3s;
}

.read-more:hover {
  color: var(--primary);
  text-shadow: 0 0 5px var(--accent);
}

/* ===== END OF FILE ===== */
