/* Reset and base */
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background: #fff;
  color: #000;
  transition: background 0.3s ease, color 0.3s ease;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2rem;
  border-bottom: 1px solid #eee;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

nav ul li {
  cursor: pointer;
  font-weight: 500;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-button {
  font-weight: bold;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 1rem;
  color: inherit;
  padding: 0.25rem 0.5rem;
  transition: color 0.3s ease;
}

.nav-button:hover {
  text-decoration: underline;
}

#themeToggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color 0.3s ease;
}

header {
  text-align: center;
  padding: 4rem 2rem 2rem;
}

header input {
  margin-top: 2rem;
  padding: 0.7rem 1rem;
  width: 80%;
  max-width: 400px;
  font-size: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #000;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
  font-size: 2.4rem;
  font-weight: bold;
}

/* Code font for header typing */
header.intro-animate h1 {
  font-family: 'Fira Code', monospace;
  font-weight: 500;
  font-size: 2.5rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

header p {
  margin-top: 0.7rem;
  color: #333;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Make articles container scrollable vertically with fixed height */
#articlesContainer {
  max-height: 60vh;
  overflow-y: auto;
  padding: 1rem 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  scroll-behavior: smooth;
}

/* Card styling with glassmorphism */
.card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  width: 300px;
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  cursor: pointer;
  will-change: transform;
  perspective: 1000px;
}

/* 3D tilt hover effect */
.card:hover {
  transform: translateZ(20px) rotateX(5deg) rotateY(5deg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.card.hide {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
  transition: opacity 0.3s ease, transform 0.3s ease;
}


.card h2 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.card p {
  color: #444;
  margin-bottom: 1rem;
}

.card a {
  text-decoration: none;
  color: #000;
  font-weight: 600;
  transition: color 0.3s ease;
}

.card a:hover {
  color: #007acc;
}

/* Thumbnail image for articles */
.card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
}

footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  color: #777;
  font-size: 0.9rem;
  border-top: 1px solid #eee;
}

/* Dark Mode */
body.dark {
  background: #111;
  color: #f1f1f1;
}

body.dark header p,
body.dark .card p,
body.dark footer {
  color: #ccc;
}

body.dark .card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark input {
  background: #222;
  color: #fff;
  border: 1px solid #555;
}

body.dark nav {
  border-bottom: 1px solid #333;
}

body.dark footer {
  border-top: 1px solid #333;
}

body.dark .card a {
  color: #aad4ff;
}

/* Typing effect */
#typing {
  display: inline-block;
  font-weight: bold;
}

/* Smooth blinking cursor */
.cursor {
  display: inline-block;
  background-color: currentColor;
  width: 1ch;
  margin-left: 0.1em;
  animation: smoothBlink 1.5s ease-in-out infinite;
  border-radius: 2px; /* soften edges */
}

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

/* Intro Animations */
.intro-animate {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.intro-animate.show {
  opacity: 1;
  transform: translateY(0);
}

/* Modal Styles */
.hidden {
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 9999;
  overflow: auto;
}

.modal.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  overflow: auto;
}

.modal-content {
  position: relative;
  background: #fff;
  padding: 2rem;
  border-radius: 1rem;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  transform: translateY(-30px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  .modal-content {
  -webkit-overflow-scrolling: touch;
}

}

.modal.show .modal-content {
  transform: translateY(0);
  opacity: 1;
}

/* Dark mode modal */
body.dark .modal-content {
  background: rgba(30, 30, 30, 0.95);
  color: #f1f1f1;
}

/* Close Button */
.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  cursor: pointer;
  user-select: none;
  background: none;
  border: none;
  color: inherit;
}

body.dark .close-btn {
  color: #eee;
}
/* Gradient Title (optional) */
.gradient-text {
  background: linear-gradient(270deg, 
    red 0%, 
    orange 14.3%, 
    yellow 28.6%, 
    green 42.9%, 
    blue 57.2%, 
    indigo 71.5%, 
    violet 85.8%, 
    red 100%);
  background-size: 1600% 1600%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rainbowShift 20s ease infinite;
  background-clip: text;
  color: transparent;
}

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

/* bg particles */
.particles {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: rgba(100, 100, 100, 0.25);
  border-radius: 50%;
  backdrop-filter: blur(4px);
  animation: floatUp linear infinite;
  transition: background 0.3s ease;
  box-shadow: 0 0 6px rgba(100, 100, 100, 0.15);
}

@keyframes floatUp {
  from {
    transform: translateY(100vh) scale(1);
    opacity: 0;
  }
  to {
    transform: translateY(-10vh) scale(1.2);
    opacity: 0.4;
  }
}

/* dark mode particles */
body.dark .particle {
  background: rgba(255, 255, 255, 0.15);
}

/* Scrollbar styling for articles container */
#articlesContainer::-webkit-scrollbar {
  width: 10px;
}

#articlesContainer::-webkit-scrollbar-track {
  background: transparent;
}

#articlesContainer::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 5px;
}

body.dark #articlesContainer::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
}
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  animation: blobMove 25s ease-in-out infinite;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: -1;
}

/* Different sizes & colors */
.blob:nth-child(1) {
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, #ff6ec4, #7873f5);
  top: 20vh;
  left: -100px;
  animation-delay: 0s;
}

.blob:nth-child(2) {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, #42e695, #3bb2b8);
  top: 60vh;
  left: 50vw;
  animation-delay: 7s;
}

.blob:nth-child(3) {
  width: 250px;
  height: 250px;
  background: linear-gradient(135deg, #fddb92, #d1fdff);
  top: 80vh;
  left: 80vw;
  animation-delay: 14s;
}

/* Blob animation - slow, smooth morph & move */
@keyframes blobMove {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    border-radius: 50% 50% 50% 50% / 50% 60% 40% 50%;
  }
  33% {
    transform: translate(20px, -30px) scale(1.1);
    border-radius: 60% 40% 70% 30% / 50% 40% 60% 50%;
  }
  66% {
    transform: translate(-20px, 20px) scale(0.9);
    border-radius: 40% 60% 30% 70% / 60% 50% 50% 40%;
  }
}
.subscribe-section {
  max-width: 420px;
  margin: 3rem auto 5rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 1rem;
  padding: 2.5rem 2rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  text-align: center;
  transition: background 0.3s ease;
}


body.dark .subscribe-section {
  background: rgba(30, 30, 30, 0.6);
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.1);
}

.subscribe-section h2 {
  margin-bottom: 0.4rem;
  font-size: 2rem;
  font-weight: 700;
  color: inherit;
}

.subscribe-section p {
  margin-bottom: 1.8rem;
  color: inherit;
  font-size: 1.1rem;
}

.subscribe-form {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}


.subscribe-section input[type="email"] {
  flex-grow: 1;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 1.5px solid rgba(0, 0, 0, 0.2);
  outline-offset: 2px;
  transition: border-color 0.3s ease;
  font-family: 'Inter', sans-serif;
}

.subscribe-section input[type="email"]:focus {
  border-color: #007acc;
  background: rgba(255, 255, 255, 0.25);
}

body.dark .subscribe-section input[type="email"] {
  border-color: #555;
  background: #222;
  color: #eee;
}

body.dark .subscribe-section input[type="email"]:focus {
  border-color: #5dade2;
  background: rgba(30, 30, 30, 0.6);
}

.subscribe-section button {
  background-color: #007acc;
  border: none;
  color: white;
  padding: 0.75rem 1.4rem;
  flex-shrink: 0;
  font-weight: 600;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-family: 'Inter', sans-serif;
  min-width: 120px
  
}

.subscribe-section button:hover {
  background-color: #82a300;
}

.subscribe-message {
  margin-top: 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1b74af;
  min-height: 1.1rem;
  text-align: center;
}



.read-time {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(0, 0, 0, 0.05);
  color: #333;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  pointer-events: none;
  user-select: none;
}
body.dark .read-time {
  background: rgba(255, 255, 255, 0.08);
  color: #eee;
  box-shadow: 0 1px 3px rgba(255, 255, 255, 0.05);
}

.gradient-text {
  font-weight: bold;
  background: linear-gradient(90deg, rgb(37, 131, 245), rgb(227, 0, 227), rgb(242, 78, 78), rgb(244, 132, 26));
  -webkit-text-fill-color: transparent; /* make text transparent for gradient to show */
  -webkit-background-clip: text;
  color: black; /* fallback for browsers without support */
}

.liquid-glass-text {
  font-size: 1rem;
  font-weight: 800;
  color: transparent;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.85),
    rgba(200, 200, 255, 0.2),
    rgba(255, 255, 255, 0.1)
  );
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  mix-blend-mode: overlay;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.2),
    0 0 12px rgba(255, 255, 255, 0.2);
  user-select: none;
}
.card .date-added {
  margin-top: 0.8rem;
  font-size: 0.85rem;
  color: #888;
  font-style: italic;
  letter-spacing: 0.3px;
  text-align: right;
}
body.dark .card .date-added {
  color: #bbb;
}
/* Admin Panel Base */
.admin-panel {
  max-width: 900px;
  margin: 4rem auto;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 1.5rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  color: inherit;
}

/* Dark mode adjustments */
body.dark .admin-panel {
  background: rgba(30, 30, 30, 0.6);
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.05);
}

/* Textarea */
.glass-textarea {
  width: 100%;
  height: 160px;
  padding: 1rem;
  font-size: 1rem;
  border-radius: 1rem;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  color: inherit;
  font-family: 'Inter', sans-serif;
  margin-bottom: 1.5rem;
  resize: vertical;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

body.dark .glass-textarea {
  background: rgba(255, 255, 255, 0.05);
}

/* Button - reuse your existing .button or .subscribe-section button */

/* Article List */
.article-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Article Card Preview */
.card-preview {
  width: 260px;
  background: rgba(255, 255, 255, 0.12);
  padding: 1rem;
  border-radius: 1rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-preview:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

body.dark .card-preview {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.05);
}

/* Date Added Label */
.card-preview .date-added {
  font-size: 0.8rem;
  color: #888;
  font-style: italic;
  margin-bottom: 0.5rem;
}

body.dark .card-preview .date-added {
  color: #bbb;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.modal-content {
  background: rgba(255, 255, 255, 0.1);
  padding: 2rem;
  border-radius: 1.2rem;
  width: 90%;
  max-width: 700px;
  color: inherit;
  backdrop-filter: blur(14px);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
  position: relative;
}

body.dark .modal-content {
  background: rgba(30, 30, 30, 0.75);
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.08);
}

/* Close Button */
.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
  user-select: none;
}
/* ----- PANEL AND LOGIN STYLES ----- */
body.dark {
  background-color: #121212;
  color: #eee;
  font-family: 'Inter', sans-serif;
  margin: 0;
  min-height: 100vh;
}

.login-container, .subscribe-section {
  max-width: 400px;
  margin: 5rem auto;
  text-align: center;
  background: rgba(255 255 255 / 0.05);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 0 20px rgba(0 0 0 / 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255 255 255 / 0.1);
}

.glass-input {
  width: 100%;
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: none;
  background: rgba(255 255 255 / 0.1);
  color: #eee;
  font-size: 1rem;
  transition: background 0.3s ease;
}

.glass-input:focus {
  outline: none;
  background: rgba(255 255 255 / 0.2);
  box-shadow: 0 0 10px #67c8ff;
}

.button {
  cursor: pointer;
  padding: 0.8rem 1.5rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  font-size: 1rem;
  transition: background-color 0.3s ease;
  user-select: none;
}

.button.primary {
  background-color: #0d6efd;
  color: white;
}

.button.primary:hover {
  background-color: #084bcc;
}

.button.secondary {
  background-color: #6c757d;
  color: white;
}

.button.secondary:hover {
  background-color: #565e64;
}

.error-text {
  color: #e66;
  font-weight: 600;
  margin-top: 0.5rem;
}

/* ----- PANEL LAYOUT ----- */
.panel-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

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

.sidebar {
  background: #1f1f1f;
  width: 240px;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #aaa;
  box-shadow: 2px 0 8px rgba(0,0,0,0.5);
}

.profile-pic {
  margin-bottom: 1.5rem;
  text-align: center;
}

.username-text {
  margin-top: 0.5rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: #eee;
}

.sidebar nav ul {
  list-style: none;
  padding: 0;
  width: 100%;
}

.sidebar nav ul li {
  margin: 1rem 0;
}

.sidebar nav ul li a {
  color: #aaa;
  text-decoration: none;
  font-weight: 600;
  display: block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: background-color 0.3s ease;
}

.sidebar nav ul li a:hover {
  background: #0d6efd;
  color: white;
}

.panel-main {
  flex: 1;
  background: #181818;
  padding: 2rem;
  overflow-y: auto;
}

.content-area {
  max-width: 800px;
  margin: 0 auto;
}

.greeting-text {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #67c8ff;
}

.panel-options {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.post-article-container input[type="text"],
.post-article-container textarea,
.post-article-container input[type="file"] {
  margin-top: 1rem;
}

/* TinyMCE overrides to match dark mode */

.tox {
  background: #121212 !important;
  color: #eee !important;
}

.tox .tox-toolbar,
.tox .tox-toolbar__primary {
  background: #1f1f1f !important;
}

.tox .tox-toolbar__button {
  color: #eee !important;
}

.tox .tox-toolbar__button--enabled {
  background-color: #0d6efd !important;
  color: white !important;
}

.tox .tox-editor-header {
  background: #1f1f1f !important;
}

.tox .tox-editor-container {
  background: #121212 !important;
  color: #eee !important;
}

.tox .tox-statusbar {
  background: #1f1f1f !important;
  color: #eee !important;
}

/* Gradient Text & Liquid Glass (your custom styles) */

.gradient-text {
  background: linear-gradient(90deg, #6a11cb, #2575fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

.liquid-glass-text {
  color: #67c8ff;
  text-shadow:
    0 0 5px rgba(103, 200, 255, 0.8),
    0 0 10px rgba(103, 200, 255, 0.6);
  font-weight: 600;
}
