﻿/* ===== VARIABLES & BASE STYLES ===== */
:root {
  --bg: #0b1529;
  --bgSoft: #1f3050;
  --text: #dee4eb;
  --textSoft: #cbd2d9;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  margin-top: 20px;
  background: var(--bg);
  color: var(--text);
  font-family: "Roboto", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

body.light {
  --bg: #dee4eb;
  --text: #0b1529;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.8;
}

.container {
  width: 100%;
  max-width: 1366px;
  padding: 0 2rem;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== TOGGLE SWITCH ===== */
.toggle {
  width: 40px;
  height: 20px;
  border-radius: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  background-color: var(--bgSoft);
  border: 0.5px solid var(--textSoft);
  position: relative;
}

.ball {
  width: 19px;
  height: 19px;
  border-radius: 50px;
  position: absolute;
  left: 0;
  background-color: var(--textSoft);
  border: 1px solid var(--bgSoft);
  transition: left 0.3s ease;
}

.light .ball {
  left: 21px;
}

/* ===== NAVBAR - COMPLETELY REVAMPED ===== */
.navbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  background-color: var(--bg);
  z-index: 1000;
  padding: 0 2rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}


.logo {
  font-weight: bold;
  font-size: 24px;
  background: linear-gradient(90deg, #4F46E5, #06B6D4, #0EA5E9, #22D3EE, #4F46E5);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientMove 4s linear infinite;
  padding: 0.5rem 1.5rem;
  display: inline-block;
  letter-spacing: 1px;
  position: relative;
}

.logo::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #4F46E5, #06B6D4, #0EA5E9, #22D3EE, #4F46E5);
  background-size: 300% 100%;
  animation: gradientMove 4s linear infinite;
  border-radius: 2px;
}

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

  100% {
    background-position: 100% 50%;
  }
}

.links {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 18px;
}

.searchButton {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: var(--bgSoft);
  color: var(--textSoft);
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.searchButton:hover {
  background-color: var(--text);
  color: var(--bg);
}

/* ===== HAMBURGER MENU (MOBILE) ===== */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 0.5rem;
  gap: 4px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--text);
  transition: 0.3s;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  padding: 2rem 0;
}

/* ===== SINGLE POST LAYOUT ===== */
.singleHeadImg {
  width: 80%;
  max-width: 900px;
  height: auto;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 8px;
  margin: 0 auto;
  display: block;
}

.singleHead {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.singleHeadTexts {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.singleHeadTitle {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.2;
}

.singleHeadDesc {
  font-size: 1.25rem;
  font-weight: 300;
}

.singleHeadDetail {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.singleAvatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  object-fit: cover;
}

.singleCategory {
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  background-color: var(--bgSoft);
  color: var(--textSoft);
  font-size: 0.875rem;
}

/* ===== IMAGE SOLUTIONS ===== */
.singleContent img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 50vh;
  margin: 1.5rem auto;
  border-radius: 0.5rem;
  object-fit: contain;
}

.singleContent .full-width-img {
  width: 100%;
  max-height: 60vh;
}

.singleContent .medium-img {
  width: 75%;
  max-height: 45vh;
}

.singleContent .small-img {
  width: 50%;
  max-height: 35vh;
}

.singleBottom {
  display: flex;
  gap: 2rem;
  margin-top: 3rem;
}

.singleContent {
  flex: 3;
  min-width: 0;
}

/* ===== RIGHT SIDEBAR ===== */
.singleRightBar {
  flex: 1;
  max-width: 300px;
  position: sticky;
  top: 120px;
  height: fit-content;
  align-self: flex-start;
}

.rightBarImg {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: 0.5rem;
  display: block;
}

.rightBarImgHr {
  display: none;
  width: 100%;
  max-height: 150px;
  object-fit: contain;
  border-radius: 0.5rem;
  margin-top: 2rem;
}


.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2.5rem;
  text-align: center;
  margin-top: 2rem;
  background: linear-gradient(135deg, #4f46e5, #06b6d4, #ff7e5f);
  background-size: 300% 300%;
  animation: gradientMove 8s ease infinite;
  color: #fff;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.2);
  width: 100%;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

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

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Logo styling */
.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: bold;
  font-size: 1.4rem;
  color: #fff;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.footer-logo img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.footer-logo:hover {
  transform: scale(1.05);
}

/* Social icons */
.social {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.social a:hover {
  background-color: #fff;
  color: #4f46e5;
  transform: scale(1.1);
}

/* ================================
   Newsletter form (your original)
   — now responsive only
   ================================ */
.newsletter {
  max-width: 400px;
  width: 100%;
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
  /* keep in one line on desktop */
  gap: 0;
  /* seamless join between input & button */
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.newsletter input {
  flex: 1 1 auto;
  min-width: 0;
  /* prevents overflow on small screens */
  padding: 0.7rem 1rem;
  border: none;
  outline: none;
  background-color: transparent;
  color: #fff;
  font-size: 1rem;
  -webkit-appearance: none;
  appearance: none;
}

.newsletter input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.newsletter button {
  flex: 0 0 auto;
  /* don't let button shrink weirdly */
  padding: 0.7rem 1.2rem;
  background-color: #ff7e5f;
  color: #fff;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  /* keep text on one line */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-appearance: none;
  appearance: none;
}

.newsletter button:hover {
  background-color: #06b6d4;
}

/* Footer text */
.footer-text {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-top: 1rem;
}

/* Fix footer spacing on smaller screens */
@media (max-width: 600px) {
  .footer {
    margin-top: 2rem !important;
    padding: 1.5rem 1rem;
  }

  /* stack input + button vertically and make both full width */
  .newsletter {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    /* nice breathing room when stacked */
    background-color: transparent;
    /* let children have radius when stacked */
    box-shadow: none;
    /* cleaner on mobile; children keep visual weight */
  }

  .newsletter input,
  .newsletter button {
    width: 100%;
    border-radius: 8px;
    /* rounded corners when stacked */
  }

  /* reapply background panel look using a wrapper feel */
  .newsletter input {
    background-color: rgba(255, 255, 255, 0.1);
  }

  .newsletter button {
    background: linear-gradient(45deg, #6d28d9, #f97316, #06b6d4);
  }
}

/* ================================
   Alternative hook you already had
   (kept & aligned with the above)
   ================================ */
.newsletter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.newsletter-form input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 0.7rem 1rem;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.newsletter-form button {
  padding: 0.7rem 1rem;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  background: linear-gradient(45deg, #6d28d9, #f97316, #06b6d4);
  color: #fff;
  cursor: pointer;
  transition: 0.3s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-appearance: none;
  appearance: none;
}

/* Stack input + button on smaller screens */
@media (max-width: 600px) {
  .newsletter-form {
    flex-direction: column;
    align-items: stretch;
  }

  .newsletter-form input,
  .newsletter-form button {
    width: 100%;
  }
}

/* Tiny devices */
@media (max-width: 320px) {
  .footer {
    gap: 1rem;
    padding: 1.2rem 0.5rem;
  }

  .footer-logo {
    font-size: 1.1rem;
  }

  .footer-logo img {
    width: 32px;
    height: 32px;
  }

  .social a {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .newsletter-form input {
    font-size: 0.9rem;
    padding: 0.7rem;
  }

  .newsletter-form button {
    font-size: 0.9rem;
    padding: 0.7rem;
  }

  .footer-text {
    font-size: 0.8rem;
  }
}
 


/* ===== LIST ITEMS ===== */
.listItem {
  display: flex;
  align-items: center;
  gap: 50px;
  margin-bottom: 50px;
}



.listItemImage {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
}

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

.listItemDetail {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.listItemAvatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.listItemCategories {
  display: flex;
  gap: 10px;
}

.listItemCategory {
  color: var(--textSoft);
  font-size: 14px;
  padding: 5px;
  border-radius: 5px;
  background-color: var(--bgSoft);
}

/* ===== CATEGORIES ===== */
.categories-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}

.category-item {
  display: block;
  padding: 1.5rem;
  background: var(--bgSoft);
  border-radius: 8px;
  transition: transform 0.2s;
}

.category-item:hover {
  transform: translateY(-3px);
}

/* ===== SEARCH STYLES ===== */
.search-container {
  position: relative;
  display: inline-block;
  margin-left: 15px;
}

.search-input {
  padding: 8px 15px 8px 40px;
  border: 1px solid #ddd;
  border-radius: 25px;
  font-size: 14px;
  width: 200px;
  transition: all 0.3s ease;
  background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2364748b' width='18px' height='18px'%3E%3Cpath d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E") no-repeat 15px center;
  background-size: 18px;
}

.search-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  width: 250px;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  list-style: none;
  padding: 0;
  margin: 5px 0 0 0;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  z-index: 1000;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* ===== COMMENTS ===== */
.comments-section {
  margin: 3rem 0;
  padding: 2rem 0;
  border-top: 1px solid #eaeaea;
}

/* ===== CATEGORIES GRID ===== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.category-card {
  background: var(--bgSoft);
  padding: 1.5rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== ENHANCED SEARCH ===== */
.search-result {
  border-bottom: 1px solid var(--bgSoft);
  padding: 1rem 0;
}

.search-result-link {
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: all 0.2s ease;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Large Tablets (1024px and below) */
@media (max-width: 1024px) {
  .container {
    padding: 0 1.5rem;
  }

  .singleBottom {
    flex-direction: column;
  }

  .singleRightBar {
    max-width: 100%;
    position: static;
    margin-top: 2rem;
  }

  .rightBarImg {
    display: none;
  }

  .rightBarImgHr {
    display: block;
  }

  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tablets (768px and below) - CRITICAL FIXES */
@media (max-width: 768px) {
  .navbar {
    height: 70px;
    padding: 0 1rem;
    flex-wrap: wrap;
  }

  .links {
    gap: 1rem;
    font-size: 16px;
    order: 2;
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
    display: none;
  }

  .links.active {
    display: flex;
    flex-direction: column;
    background: var(--bg);
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    padding: 1rem;
    border-top: 1px solid var(--bgSoft);
  }

  .hamburger {
    display: flex;
  }

  .listItem {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .listItemImage {
    width: 100%;
    max-width: 300px;
  }

  .search-container {
    margin: 10px 0;
    width: 100%;
    order: 3;
  }

  .search-input {
    width: 100%;
  }

  .search-input:focus {
    width: 100%;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .singleHeadTitle {
    font-size: 1.8rem;
  }

  .singleHeadDesc {
    font-size: 1.1rem;
  }
}

/* Mobile (480px and below) - SAMSUNG A06 FIXES */
@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .navbar {
    height: 60px;
    padding: 0 0.5rem;
  }

  .logo {
    font-size: 20px;
    padding: 0.5rem;
  }

  .links.active {
    top: 60px;
  }

  .categories-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .category-card {
    padding: 1.25rem;
  }

  .singleHeadTitle {
    font-size: 1.5rem;
  }

  .singleHeadDesc {
    font-size: 1rem;
  }

  .singleContent img {
    max-height: 40vh;
  }

  .search-results {
    left: 10px;
    right: 10px;
    width: auto !important;
  }
}

/* iPad Air Specific (820px) */
@media (min-width: 769px) and (max-width: 820px) {
  .navbar {
    margin-top: 2rem;
  }

  .container {
    padding: 0 1.5rem;
  }

  .singleHeadImg {
    width: 90%;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Samsung A06 Specific (360px) */
@media (max-width: 360px) {
  .navbar {
    height: 55px;
  }

  .logo {
    font-size: 18px;
  }

  .links.active {
    top: 55px;
    padding: 0.5rem;
  }

  .singleHeadTitle {
    font-size: 1.3rem;
  }

  .search-input {
    font-size: 12px;
    padding: 6px 12px 6px 35px;
    background-position: 12px center;
  }
}

/* ===== UTILITY CLASSES ===== */
.hidden-mobile {
  display: block;
}

.visible-mobile {
  display: none;
}

@media (max-width: 768px) {
  .hidden-mobile {
    display: none;
  }

  .visible-mobile {
    display: block;
  }
}

/* ===== JAVASCRIPT INTERACTION CLASSES ===== */
.menu-open .links {
  display: flex !important;
}

.menu-open .hamburger span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-open .hamburger span:nth-child(2) {
  opacity: 0;
}

.menu-open .hamburger span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* ===== PRINT STYLES ===== */
@media print {

  .navbar,
  .footer,
  .singleRightBar {
    display: none;
  }

  .container {
    padding: 0;
    max-width: none;
  }

  body {
    background: white;
    color: black;
  }
}

/* ===== HIGH CONTRAST MODE SUPPORT ===== */
@media (prefers-contrast: high) {
  :root {
    --bg: #000000;
    --bgSoft: #1a1a1a;
    --text: #ffffff;
    --textSoft: #cccccc;
  }
}

/* ===== REDUCED MOTION SUPPORT ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .logo,
  .logo::after {
    animation: none;
  }
}

/* ===== HAMBURGER VISIBILITY FIX ===== */
.hamburger {
  display: none;
  /* Hidden on desktop by default */
  flex-direction: column;
  cursor: pointer;
  padding: 0.75rem;
  gap: 5px;
  z-index: 1001;
  background: var(--bgSoft);
  border: 2px solid var(--textSoft);
  border-radius: 8px;
  margin-left: auto;
  /* Push to right side */
}

.hamburger .bar {
  width: 25px;
  height: 3px;
  background: var(--text);
  transition: all 0.3s ease;
  border-radius: 2px;
}

/* CRITICAL: Show hamburger on mobile */
@media (max-width: 768px) {
  .navbar {
    position: relative;
    /* Needed for absolute positioning */
  }

  .hamburger {
    display: flex !important;
    /* Force show on mobile */
    position: relative;
    margin-left: auto;
    /* Push to far right */
  }

  .links {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 1.5rem;
    border-top: 1px solid var(--bgSoft);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
  }

  .links.active {
    display: flex !important;
    animation: slideDown 0.3s ease;
  }
}

/* Animation for menu */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hamburger animation when open */
.hamburger.menu-open .bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.menu-open .bar:nth-child(2) {
  opacity: 0;
}

.hamburger.menu-open .bar:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}


/* ===== STICKY NAVBAR FIX FOR MOBILE ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Ensure parent elements don't interfere with sticky */
html,
body {
  height: 100%;
}

.container {
  min-height: 100vh;
  position: relative;
}

/* Mobile-specific sticky fixes */
@media (max-width: 768px) {
  .navbar {
    position: fixed;
    /* Use fixed instead of sticky for mobile */
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
  }

  /* Add padding to body to compensate for fixed navbar */
  body {
    padding-top: 70px;
    /* Adjust based on your navbar height */
  }

  /* Ensure navbar stays on top of everything */
  .navbar {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  }
}

/* Safari specific fixes */
@supports (-webkit-touch-callout: none) {
  .navbar {
    position: -webkit-sticky;
  }
}