:root {
  --primary: #000;
  --primary-dark: #ffeb3b;
  --accent: #120229;
  --text: #1c2526;
  --text-light: #5f6c7b;
  --bg: #ffffff;
  --bg-secondary: #fcfcfc;
  --bg-dark: #121212;
  --text-dark: #e8ecef;
  --border-radius: 12px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode {
  --bg: var(--bg-dark);
  --text: var(--text-dark);
  --bg-secondary: #1e1e1e;
  --text-light: #fcfcfc;
  --primary: var(--primary-dark);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: clamp(14px, calc(1rem + 1vw), 16px);
  transition: var(--transition);
}

h1,
h2,
h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  line-height: 1.2; 
}

h1 {
  font-size: clamp(1.8rem, calc(1.5rem + 3vw), 2.5rem);
}

h2,
h3 {
  font-size: clamp(1.3rem, calc(1rem + 2vw), 1.8rem);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

a:active,
.nav a:active,
.sidebar-nav a:active {
  transform: scale(1.02);
}

.author-link {
  color: #ff0505;
}

.dark-mode .author-link {
  color: #faf818;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.header {
  background: var(--bg);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: var(--transition);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  margin-bottom:15px;
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.3rem, calc(1rem + 2vw), 1.8rem);
  font-weight: 700;
  color: var(--primary);
}

.nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav a {
  font-size: clamp(13px, calc(0.9rem + 0.5vw), 15px);
  font-weight: 500;
}

.nav .dropdown {
  position: relative;
}

.nav .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg);
  box-shadow: var(--shadow);
  border-radius: var(--border-radius);
  padding: 0.75rem;
  min-width: 150px;
  z-index: 1000;
}

.nav .dropdown-menu.active {
  display: block;
}

.nav .dropdown-menu li {
  margin-bottom: 0.5rem;
}

.nav .dropdown-menu a {
  font-size: 0.95rem;
}

.header-actions {
  display: flex;
  gap: 1rem;
}

.header-actions button,
.btn,
.pagination-link,
.search-bar button,
.search-close,
.nav-close,
.sidebar-toggle,
td button,
.back-to-top {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--border-radius);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  transition: var(--transition);
}

.material-icons {
  font-size: 1.5rem;
  color: var(--text);
}

.dark-mode .material-icons:not(.btn-primary .material-icons, .back-to-top .material-icons, .search-bar button .material-icons, .search-close .material-icons) {
  color: var(--text-dark);
}

.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.search-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.search-bar {
  display: flex;
  max-width: 600px;
  width: 90%;
  position: relative;
}

.search-bar input,
.form-group input,
.form-group textarea,
.form-group select,
.email-address input,
.email-actions select {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--text-light);
  border-radius: var(--border-radius);
  background: var(--bg-secondary);
  color: var(--text);
  font-size: clamp(14px, calc(0.9rem + 0.5vw), 16px);
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
}

.search-bar input:focus,
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.email-address input:focus,
.email-actions select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

.search-bar button {
  background: var(--primary);
  padding: 0.75rem;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.search-bar button .material-icons,
.btn-primary .material-icons,
.back-to-top .material-icons {
  color: #fff;
}

.dark-mode .search-bar button .material-icons,
.dark-mode .btn-primary .material-icons,
.dark-mode .back-to-top .material-icons {
  color: #000;
}

.search-close {
  position: absolute;
  top: -3rem;
  right: 0;
}

.search-close .material-icons {
  color: #ffeb3b;
  font-size: 2rem;
}

.nav-close {
  display: none;
  position: absolute;
  top: 1rem;
  right: 1.5rem;
}

.hero {
  display: grid;
  gap: 2rem;
  padding: 3rem 0;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
}

.hero-image img {
  width: 100%;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: transform 0.5s ease;
}

.hero-image img:hover {
  transform: scale(1.02);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  padding: 0.75rem 1.5rem;
}

.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-2px);
}

.dark-mode .btn-primary {
  background: var(--primary);
  color: #000;
}

.dark-mode .btn-primary:hover {
  background: var(--accent);
  color: #fff;
}

.featured,
.latest-posts,
.post {
  padding: 2rem 0;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.card-featured {
  grid-column: span 2;
}

.card-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card:hover .card-image img {
  transform: scale(1.05);
}

.card-content {
  padding: 1rem;
}

.card-content .category {
  display: inline-block;
  font-size: 0.9rem;
  color:  var(--primary);
  margin-bottom: 0.5rem;
}

.card-content h3 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.1rem, calc(0.9rem + 1vw), 1.4rem);
}

.card-content p,
.post-content p,
.author-bio,
#network-info,
.footer-section p,
.footer-section ul,
.footer-copy,
.comment-placeholder,
.ad-placeholder,
.processing-content p {
  color: var(--text-light);
  font-size: clamp(0.9rem, calc(0.8rem + 0.5vw), 1rem);
}

.meta {
  font-size: clamp(0.8rem, calc(0.7rem + 0.5vw), 0.9rem);
}

.content-sidebar {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 2rem;
  padding: 1rem 1.5rem;
}

.main-content,
.contact-form,
.phone-form,
.search-form,
.login-form,
.post-form,
.category-form,
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.widget {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.widget h3 {
  margin-bottom: 0.75rem;
}

.widget ul,
.sidebar-nav ul,
.footer-section ul,
.nav ul {
  list-style: none;
}

.widget ul li,
.sidebar-nav li,
.footer-section ul li,
.nav ul li {
  margin-bottom: 0.5rem;
}

.widget ul li a,
.sidebar-nav ul li a {
  font-weight: 500;
}

.ad-slot {
  margin: 1.5rem 0;
  text-align: center;
}

.ad-middle {
  max-width: 300px;
  margin: 1rem auto;
}

.footer {
  background: var(--bg-secondary);
  padding: 3rem 0;
  margin-top: 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.footer-section h3 {
  margin-bottom: 1rem;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.footer-copy {
  margin-top: 1.5rem;
}

.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--primary);
  border-radius: 50%;
  width: 48px;
  height: 48px;
}

.back-to-top:hover {
  background: var(--accent);
  transform: scale(1.1);
}

.waitingtime {
  color: var(--primary);
  font-size: clamp(2rem, calc(1.5rem + 3vw), 3rem);
}

.preloader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  transition: opacity 0.5s ease;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--primary);
  border-top: 4px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.breadcrumb {
  display: flex;
  list-style: none;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.breadcrumb li {
  font-size: 0.9rem;
}

.breadcrumb li::after {
  content: '>';
  margin-left: 0.5rem;
}

.breadcrumb li:last-child::after {
  content: none;
}

/* Related Posts Styling */
.related-posts {
  margin-top: 40px;
  padding: 20px 0;
  border-top: 1px solid #e0e0e0;
}

.related-posts h3 {
  font-family: 'Inter', sans-serif;
  font-size: clamp(1.1rem, calc(0.9rem + 1vw), 1.3rem);
  margin-bottom: 20px;
 
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.related-post {
  background: var(--bg-secondary);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease;
}

.related-post:hover {
  transform: translateY(-5px);
}

.related-post img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.related-post-content {
  padding: 15px;
}

.related-post-content h4 {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  margin: 0 0 10px;
  color: #222;
}

.related-post-content p {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #666;
  margin: 0;
}

.related-post a {
  text-decoration: none;
  color: inherit;
}

@media (max-width: 768px) {
  .related-posts-grid {
    grid-template-columns: 1fr;
  }
}

.post {
  max-width: 1000px;
  margin: 0 auto;
}

.post-image {
  width: 100%;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.post-tags,
.share-buttons,
.comments,
.tag-cloud {
  margin: 1.5rem 0;
}

.post-tags h3,
.share-buttons h3 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.1rem, calc(0.9rem + 1vw), 1.3rem);
}

.post-tags .tag,
.tag-cloud .tag {
  display: inline-block;
  background: var(--bg-secondary);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  transition: var(--transition);
}

.post-tags .tag:hover,
.tag-cloud .tag:hover {
  background: var(--primary);
  color: #fff;
}

.post-tags .tag::before,
.tag-cloud .tag::before {
  content: '#';
}

.ad-slot.ad-first .ad-placeholder::after {
  content: ' (After First Paragraph)';
}

.ad-slot.ad-middle .ad-placeholder::after {
  content: ' (Middle of Article)';
}

.ad-slot.ad-last .ad-placeholder::after {
  content: ' (Before Last Paragraph)';
}

.ad-slot.ad-top .ad-placeholder::after {
  content: ' (Top Ad)';
}

.ad-slot.ad-bottom .ad-placeholder::after {
  content: ' (Bottom Ad)';
}

.processing-content {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.processing-content h2 {
  font-size: clamp(1.5rem, calc(1.2rem + 2vw), 2rem);
}

.lets-go,
.explore-articles {
  display: none;
  margin-top: 1.5rem;
}

.lets-go.visible,
.explore-articles.visible {
  display: inline-block;
}

.code-display {
  font-size: clamp(1.2rem, calc(1rem + 1vw), 1.5rem);
  font-weight: 700;
  color: var(--primary);
  margin: 1.5rem 0;
  display: none;
}

.code-display.visible {
  display: block;
}

.email-tool {
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.email-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.email-address {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.email-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.email-content {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.email-list {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  flex: 1;
  min-width: 300px;
}

.email-list.hidden {
  display: none;
}

.email-list ul {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--text-light);
  border-radius: var(--border-radius);
}

.email-list li {
  padding: 0.75rem;
  border-bottom: 1px solid var(--bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s;
}

.email-list li:hover {
  background: #f1f1f1;
}

.email-list li.active {
  background: #e6f0ff;
}

.email-sender {
  flex: 2;
  font-weight: 500;
}

.email-subject {
  flex: 3;
}

.email-time {
  flex: 1;
  text-align: right;
  color: var(--text-light);
}

.email-detail {
  flex: 1;
  min-width: 300px;
  border: 1px solid var(--text-light);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  display: none;
}

.email-detail.active {
  display: block;
  width: 100%;
}

.email-detail-content p {
  margin: 0.75rem 0;
}

.email-detail-body {
  max-height: 500px;
  overflow-y: auto;
  border-top: 1px solid var(--bg);
  padding-top: 0.75rem;
  line-height: 1.6;
}

.email-detail-body img {
  max-width: 100%;
  height: auto;
}

.email-detail-body a {
  color: #1a73e8;
  text-decoration: underline;
}

.email-back {
  margin-bottom: 0.75rem;
}

.copy-feedback {
  display: none;
  color: #28a745;
  font-size: 0.9rem;
  margin-left: 0.75rem;
}

.copy-feedback.show {
  display: inline;
}

.expiration {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 0.75rem;
}

.loading {
  display: none;
  text-align: center;
  padding: 1.5rem;
}

.loading.show {
  display: block;
}

.phone-tool {
  max-width: 600px;
  margin: 0 auto;
  padding: 1.5rem 0;
}

.network-logo {
  width: 100px;
  height: auto;
  margin-bottom: 1rem;
}

.phone-result {
  margin-top: 1.5rem;
  text-align: center;
}

.phone-result.hidden {
  display: none;
}

.error {
  color: #d32f2f;
}

.error.hidden {
  display: none;
}

.author-profile {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 0;
  text-align: center;
}

.author-image {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.search-form .form-group {
  flex-direction: row;
}

.processing-container {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.countdown-container,
.final-countdown-container {
  text-align: center;
  margin: 1.5rem 0;
}

.countdown-container h2,
.final-countdown-container h2 {
  margin-bottom: 1rem;
}

.continue-btn,
.complete-btn {
  margin: 1.5rem auto;
}

#scroll-instruction,
#final-scroll-instruction {
  margin-top: 1rem;
  font-weight: 500;
  color: var(--primary);
}

#completion-code {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 1rem;
}

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.login-form {
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  max-width: 400px;
  width: 100%;
}

.admin-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 300px;
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: var(--border-radius);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
  background: var(--primary);
  color: #fff;
}

.admin-main {
  margin-left: 250px;
  flex: 1;
  padding: 1.5rem;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.admin-section {
  background: var(--bg);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.post-form-container {
  margin-top: 1.5rem;
}

.thumbnail-preview {
  max-width: 200px;
  margin-top: 0.75rem;
  border-radius: var(--border-radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th,
td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--text-light);
}

th {
  font-weight: 600;
  color: var(--primary);
}

td button:hover {
  color: var(--accent);
}

.pagination {
  margin-top: 1.5rem;
  text-align: center;
}

.pagination ul {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.pagination li {
  display: inline-flex;
}

.pagination-link {
  background: var(--bg-secondary);
  color: var(--text);
  font-size: clamp(13px, calc(0.9rem + 0.5vw), 15px);
}

.pagination-link:hover {
  background: var(--primary);
  color: var(--bg-secondary);
  transform: translateY(-2px);
}

.pagination-link.active {
  background: var(--primary);
  color: var(--bg-secondary);
  font-weight: normal;
  cursor: default;
}

.pagination-link:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pagination-link.disabled {
  background: var(--bg-secondary);
  color: var(--text-light);
  cursor: not-allowed;
  opacity: 0.6;
}

.form-group textarea {
  resize: vertical;
}

@media (max-width: 1024px) {

  .hero,
  .content-sidebar,
  .email-content {
    grid-template-columns: 1fr;
  }

  .hero-image {
    order: -1;
  }

  .card-featured {
    grid-column: span 1;
  }

  .sidebar {
    width: 100%;
  }
}

@media (max-width: 768px) {

  .nav,
  .sidebar {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 2000;
    padding: 5rem 1.5rem;
  }

  .nav.active,
  .sidebar.active {
    display: block;
  }

  .nav ul,
  .sidebar-nav ul {
    flex-direction: column;
    gap: 1rem;
  }

  .nav ul li a,
  .sidebar-nav ul li a {
    font-size: clamp(1rem, calc(0.9rem + 1vw), 1.2rem);
  }

  .nav .dropdown-menu,
  .sidebar-nav .dropdown-menu {
    position: static;
    box-shadow: none;
    padding: 0.5rem 1rem;
  }

  .nav-close,
  .sidebar-toggle {
    display: block;
  }

  .search-close {
    top: -3.75rem;
    right: 1rem;
  }

  .search-form .form-group {
    flex-direction: column;
  }

  .admin-main {
    margin-left: 0;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.active {
    transform: translateX(0);
  }
}

@media (max-width: 600px) {
  .pagination ul {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .pagination-link {
    padding: 0.5rem 0.75rem;
    min-width: 36px;
    min-height: 36px;
  }
}

@media (min-width: 769px) {
  .nav-toggle {
    display: none;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

img,
.spinner {
  cache-control: max-age=31536000, immutable;
}