/* DonDoIT Custom Styles - Index Page Enhancements */
/* These styles override the re-terminal theme for a more polished look */

/* ============================================
   POST CARD IMPROVEMENTS
   ============================================ */

/* Add visual separation to post cards */
.post.on-list {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 24px;
  margin: 24px 0;
  transition: all 0.3s ease;
}

.post.on-list:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(0, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* Remove default border-bottom since we have card borders now */
.post.on-list:not(:last-of-type) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* ============================================
   TAG STYLING - PILL BADGES
   ============================================ */

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  opacity: 1 !important;
}

.post-tags a {
  display: inline-block;
  background: rgba(0, 255, 255, 0.1);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.post-tags a:hover {
  background: var(--accent);
  color: var(--background);
  border-color: var(--accent);
}

/* ============================================
   READ MORE BUTTON ENHANCEMENT
   ============================================ */

.read-more.button {
  display: inline-block;
  padding: 10px 20px;
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
  border-radius: 4px;
  font-weight: 600;
  transition: all 0.3s ease;
  text-decoration: none;
}

.read-more.button:hover {
  background: var(--accent);
  color: var(--background);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
}

/* ============================================
   POST TITLE REFINEMENTS
   ============================================ */

.post-title a {
  transition: color 0.2s ease;
}

.post-title a:hover {
  text-shadow: 0 0 10px var(--accent);
}

/* ============================================
   INDEX HERO SECTION (INTRO)
   ============================================ */

.index-content {
  text-align: center;
  padding: 20px 0 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
}

/* Avatar glow effect */
.index-content img[alt="avatar"] {
  border-radius: 50%;
  border: 3px solid var(--accent);
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.index-content img[alt="avatar"]:hover {
  box-shadow: 0 0 40px rgba(0, 255, 255, 0.5);
  transform: scale(1.02);
}

/* Badge buttons alignment */
#badges {
  margin: 20px 0;
}

#badges a img {
  transition: transform 0.2s ease;
}

#badges a:hover img {
  transform: translateY(-2px);
}

/* Intro heading style */
.index-content h1 {
  margin-top: 20px;
  font-size: 1.8rem;
}

/* ============================================
   SPACING & LAYOUT REFINEMENTS
   ============================================ */

.posts {
  padding-top: 10px;
}

.post-meta {
  font-size: 0.9rem;
}

.post-content {
  line-height: 1.7;
  opacity: 0.85;
}

/* ============================================
   MOBILE RESPONSIVE ADJUSTMENTS
   ============================================ */

/* ============================================
   HERO SECTION - SIDE BY SIDE LAYOUT
   ============================================ */

.hero-section {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 40px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 30px;
}

.hero-avatar {
  flex-shrink: 0;
}

.hero-avatar img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
  transition: all 0.3s ease;
  object-fit: cover;
}

.hero-avatar img:hover {
  box-shadow: 0 0 50px rgba(0, 255, 255, 0.5);
  transform: scale(1.05);
}

.hero-content {
  flex: 1;
}

.hero-content h1 {
  margin: 0 0 12px 0;
  font-size: 2rem;
  color: var(--accent);
}

.hero-tagline {
  font-size: 1.1rem;
  opacity: 0.85;
  margin: 0 0 20px 0;
  line-height: 1.6;
}

.hero-badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-badges a {
  transition: transform 0.2s ease;
  display: inline-block;
}

.hero-badges a:hover {
  transform: translateY(-3px);
}

/* ============================================
   POST GRID LAYOUT (2 COLUMNS)
   ============================================ */

.posts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  padding-top: 10px;
}

.post.on-list {
  margin: 0; /* Remove margins since grid gap handles spacing */
}

/* ============================================
   MOBILE RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 900px) {
  /* Stack posts in single column on tablets/mobile */
  .posts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  /* Stack hero section vertically on mobile */
  .hero-section {
    flex-direction: column;
    text-align: center;
    gap: 24px;
    padding: 30px 0;
  }

  .hero-avatar img {
    width: 140px;
    height: 140px;
  }

  .hero-content h1 {
    font-size: 1.6rem;
  }

  .hero-badges {
    justify-content: center;
  }

  .post.on-list {
    padding: 16px;
  }

  .post-tags {
    gap: 6px;
  }

  .post-tags a {
    padding: 3px 10px;
    font-size: 0.8rem;
  }

  .read-more.button {
    padding: 8px 16px;
  }
}

/* ============================================
   SEARCH BAR STYLING
   ============================================ */

.search-container {
  position: relative;
  margin-left: auto;
  margin-right: 20px;
}

.search-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px 14px;
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  color: var(--color);
  width: 200px;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
  width: 260px;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.15);
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Search Results Dropdown */
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  background: var(--background);
  border: 1px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.search-results.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.search-result-item {
  display: block;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--color);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s ease;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: rgba(0, 255, 255, 0.1);
}

.search-result-title {
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
}

.search-result-meta {
  font-size: 0.8rem;
  opacity: 0.7;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.search-result-date {
  color: rgba(255, 255, 255, 0.5);
}

.search-tag {
  background: rgba(0, 255, 255, 0.1);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
}

.search-no-results {
  padding: 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
}

/* Mobile search adjustments */
@media (max-width: 768px) {
  .search-container {
    margin: 10px 0;
    order: 10;
    width: 100%;
  }

  .search-input {
    width: 100%;
  }

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

  .search-results {
    left: -20px;
    right: -20px;
    width: calc(100% + 40px);
  }
}

/* ============================================
   POSTS PAGE - HEADER
   ============================================ */

.posts-header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.posts-header h1 {
  font-size: 2.2rem;
  color: var(--accent);
  margin: 0 0 10px 0;
}

.posts-subtitle {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1rem;
  margin: 0;
}

/* ============================================
   POSTS PAGE - TOPIC CARDS
   ============================================ */

.topic-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.topic-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

.topic-card:hover {
  background: rgba(0, 255, 255, 0.05);
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 255, 255, 0.15);
}

.topic-icon {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px;
}

.topic-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.topic-info h3 {
  margin: 0 0 4px 0;
  font-size: 1.1rem;
  color: var(--accent);
}

.topic-count {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   POSTS PAGE - SECTION DIVIDER
   ============================================ */

.section-divider {
  display: flex;
  align-items: center;
  margin: 40px 0 30px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.section-divider span {
  padding: 0 20px;
}

/* ============================================
   POSTS PAGE - MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .topic-cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .topic-card {
    padding: 16px;
  }

  .topic-icon {
    width: 50px;
    height: 50px;
  }

  .posts-header h1 {
    font-size: 1.8rem;
  }

  .section-divider {
    margin: 30px 0 20px;
  }
}
