@import url('./variables.css');

/* =========================================================
   1. RESET & CORE STYLING
   ========================================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--clr-bg-page);
  color: var(--clr-text-main);
  font-family: var(--font-family-body);
  font-size: 0.95rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--clr-accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--clr-accent-hover);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* =========================================================
   2. TYPOGRAPHY & HEADING HIERARCHY
   ========================================================= */
h1, h2, h3, h4, h5, h6 {
  color: var(--clr-text-main);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.hero-title {
  font-family: var(--font-family-serif);
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  font-weight: 700;
  color: #171717;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--clr-text-main);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--clr-text-main);
  margin-bottom: 1rem;
}

/* =========================================================
   3. BUTTON SYSTEM
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 44px;
  padding: 0 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--clr-accent-primary);
  color: var(--clr-text-on-accent);
  box-shadow: 0 2px 8px rgba(167, 45, 103, 0.25);
}

.btn-primary:hover {
  background-color: var(--clr-accent-hover);
  color: var(--clr-text-on-accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(167, 45, 103, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: var(--clr-bg-subtle);
  color: var(--clr-text-main);
  border: 1px solid var(--clr-border);
}

.btn-secondary:hover {
  background-color: var(--clr-border);
  color: var(--clr-text-main);
}

.btn-ghost {
  background-color: transparent;
  color: var(--clr-text-muted);
}

.btn-ghost:hover {
  background-color: var(--clr-bg-subtle);
  color: var(--clr-text-main);
}

.btn-danger {
  background-color: var(--clr-danger);
  color: #FFFFFF;
}

.btn-danger:hover {
  background-color: #B91C1C;
}

.btn-sm {
  height: 36px;
  padding: 0 0.85rem;
  font-size: 0.825rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  height: 50px;
  padding: 0 1.75rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-text-muted);
}

.btn-icon:hover {
  background-color: var(--clr-bg-subtle);
  color: var(--clr-accent-primary);
}

/* =========================================================
   4. FORM CONTROLS & INPUTS
   ========================================================= */
.form-group {
  margin-bottom: 1.1rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--clr-text-main);
  margin-bottom: 0.4rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  height: 46px;
  padding: 0 1rem;
  background-color: var(--clr-bg-page);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  color: var(--clr-text-main);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  outline: none;
}

.form-textarea {
  height: auto;
  min-height: 100px;
  padding: 0.8rem 1rem;
  resize: vertical;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--clr-accent-primary);
  background-color: #FFFFFF;
  box-shadow: 0 0 0 3.5px var(--clr-accent-soft);
}

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--clr-text-subtle);
}

/* =========================================================
   5. HEADER & NAVIGATION SYSTEM
   ========================================================= */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--clr-bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--clr-border);
}

.nav-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.search-bar-wrapper {
  flex: 1;
  max-width: 340px;
  margin: 0 0.8rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--clr-text-main);
  letter-spacing: -0.03em;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background-color: var(--clr-accent-primary);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(167, 45, 103, 0.3);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background-color: var(--clr-bg-subtle);
  padding: 0.25rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--clr-border-light);
}

.nav-link {
  padding: 0.5rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--clr-text-muted);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link:hover {
  color: var(--clr-text-main);
  background-color: rgba(255, 255, 255, 0.6);
}

.nav-link.active {
  color: var(--clr-accent-primary);
  background-color: #FFFFFF;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Notification Bell Badge */
.notif-bell-btn {
  position: relative;
}

.notif-unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: var(--clr-accent-primary);
  color: #FFFFFF;
  font-size: 0.7rem;
  font-weight: 700;
  height: 18px;
  min-width: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #FFFFFF;
}

/* =========================================================
   6. LAYOUT & GRID STRUCTURE
   ========================================================= */
.app-layout {
  max-width: 1240px;
  margin: 1.5rem auto 3rem;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 240px 1fr 310px;
  gap: 1.75rem;
  align-items: start;
}

.sidebar-left, .sidebar-right {
  position: sticky;
  top: 80px;
}

.main-content {
  min-width: 0;
}

/* Card Styling */
.card {
  background-color: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.25rem;
}

/* =========================================================
   7. HERO BANNER
   ========================================================= */
.hero-banner {
  background: linear-gradient(135deg, #FFFFFF 0%, #FBEFF5 50%, #FAF6F0 100%);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-xl);
  padding: 3.2rem 2.2rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-md);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-subtitle {
  color: var(--clr-text-muted);
  font-size: 1.05rem;
  max-width: 580px;
  margin: 0.8rem auto 1.8rem;
  line-height: 1.6;
}

/* =========================================================
   8. POST CARD DESIGN (SOCIAL FASHION CARD)
   ========================================================= */
.post-card {
  background-color: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.post-card:hover {
  box-shadow: var(--shadow-lg);
}

.post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.post-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background-color: var(--clr-accent-soft);
  color: var(--clr-accent-primary);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  object-fit: cover;
  border: 1.5px solid var(--clr-border-light);
}

.user-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--clr-text-main);
  line-height: 1.3;
}

.user-username {
  font-size: 0.825rem;
  color: var(--clr-text-muted);
}

.post-time {
  font-size: 0.8rem;
  color: var(--clr-text-subtle);
}

.post-media-container {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 0.85rem 0;
  background-color: var(--clr-bg-subtle);
  border: 1px solid var(--clr-border-light);
  max-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-media-container img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}

.post-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.6rem;
  border-top: 1px solid var(--clr-border-light);
  margin-top: 0.8rem;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--clr-text-muted);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.action-btn:hover {
  color: var(--clr-accent-primary);
  background-color: var(--clr-accent-soft);
}

.action-btn.liked {
  color: var(--clr-accent-primary);
}

.post-caption {
  font-size: 0.95rem;
  color: var(--clr-text-main);
  margin: 0.6rem 0;
  line-height: 1.5;
}

.hashtag {
  color: var(--clr-accent-primary);
  font-weight: 600;
  margin-right: 0.3rem;
}

.hashtag:hover {
  text-decoration: underline;
}

/* Product Tag Chips */
.product-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--clr-accent-soft);
  color: var(--clr-accent-primary);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.5rem;
  border: 1px solid rgba(167, 45, 103, 0.15);
  transition: transform var(--transition-fast);
}

.product-chip:hover {
  transform: translateY(-1px);
}

/* =========================================================
   9. "NE GİYSEM?" OUTFIT BATTLES (A/B BATTLES)
   ========================================================= */
.battle-card {
  background-color: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-md);
}

.battle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 1.2rem 0;
}

.battle-option-box {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--clr-border);
  background-color: var(--clr-bg-subtle);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.battle-option-box:hover {
  border-color: var(--clr-accent-primary);
  transform: translateY(-2px);
}

.battle-option-img {
  width: 100%;
  height: 320px;
  object-fit: cover;
}

.battle-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background-color: var(--clr-accent-primary);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.battle-badge.badge-b {
  background-color: var(--clr-accent-warm);
}

.vote-bar-container {
  height: 8px;
  background-color: var(--clr-border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 0.6rem;
}

.vote-bar-fill {
  height: 100%;
  background-color: var(--clr-accent-primary);
  transition: width 0.4s ease;
}

/* =========================================================
   10. CHALLENGES / YARIŞMALAR
   ========================================================= */
.challenge-card {
  background-color: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-md);
}

.challenge-cover {
  height: 200px;
  width: 100%;
  object-fit: cover;
}

.challenge-content {
  padding: 1.5rem;
}

.challenge-meta-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.8rem 0 1.2rem;
  font-size: 0.85rem;
  color: var(--clr-text-muted);
}

/* Status Chips */
.badge-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  background-color: var(--clr-bg-subtle);
  color: var(--clr-text-muted);
  border: 1px solid var(--clr-border-light);
}

.badge-tag.badge-active {
  background-color: var(--clr-accent-soft);
  color: var(--clr-accent-primary);
  border-color: rgba(167, 45, 103, 0.2);
}

.badge-tag.badge-vip {
  background-color: #FFFBEB;
  color: var(--clr-accent-gold);
  border-color: rgba(217, 119, 6, 0.25);
}

/* =========================================================
   11. MODAL SYSTEM & OVERLAYS
   ========================================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(23, 23, 23, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

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

.modal-box {
  background-color: var(--clr-bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  border: 1px solid var(--clr-border);
  max-width: 520px;
  width: 100%;
  padding: 2rem;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--clr-text-main);
}

.modal-close {
  font-size: 1.5rem;
  color: var(--clr-text-muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
}

.modal-close:hover {
  background-color: var(--clr-bg-subtle);
  color: var(--clr-text-main);
}

.modal-tabs {
  display: flex;
  background-color: var(--clr-bg-subtle);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
}

.tab-btn {
  flex: 1;
  height: 38px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--clr-text-muted);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.tab-btn.active {
  background-color: #FFFFFF;
  color: var(--clr-accent-primary);
  box-shadow: var(--shadow-sm);
}

/* Alert Messages */
.alert-message {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: none;
}

.alert-danger {
  background-color: var(--clr-danger-soft);
  color: var(--clr-danger);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.alert-success {
  background-color: var(--clr-success-soft);
  color: var(--clr-success);
  border: 1px solid rgba(22, 133, 91, 0.2);
}

/* =========================================================
   12. MOBILE STICKY BOTTOM NAVIGATION BAR
   ========================================================= */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background-color: var(--clr-bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--clr-border);
    align-items: center;
    justify-items: center;
    z-index: 999;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    width: 100vw;
    max-width: 100vw;
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--clr-text-muted);
    width: 100%;
    height: 100%;
    text-decoration: none;
    box-sizing: border-box;
  }

  .mobile-nav-item.active {
    color: var(--clr-accent-primary);
  }

  .mobile-create-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
  }

  .mobile-create-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background-color: var(--clr-accent-primary);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    border: none;
    box-shadow: 0 4px 12px rgba(167, 45, 103, 0.35);
    cursor: pointer;
  }
}

/* =========================================================
   13. POST CARD — JS-GENERATED COMPONENTS
   ========================================================= */
.post-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.author-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background-color: var(--clr-accent-soft);
  color: var(--clr-accent-primary);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.author-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.author-name {
  font-size: 0.925rem;
  font-weight: 700;
  color: var(--clr-text-main);
}

.author-handle {
  font-size: 0.8rem;
  color: var(--clr-text-muted);
}

.post-media-grid {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 0.85rem 0;
  background-color: var(--clr-bg-subtle);
  border: 1px solid var(--clr-border-light);
}

.post-media-img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  display: block;
}

.post-actions-bar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--clr-border-light);
  margin-top: 0.6rem;
}

.like-icon, .save-icon {
  font-size: 1.05rem;
}

.like-count, .comment-count {
  font-size: 0.85rem;
}

.action-btn.saved {
  color: var(--clr-accent-primary);
}

.hashtag-link {
  color: var(--clr-accent-primary);
  font-weight: 600;
}

.hashtag-link:hover {
  text-decoration: underline;
}

/* Post Products */
.post-products-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.product-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background-color: var(--clr-accent-soft);
  color: var(--clr-accent-primary);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(167, 45, 103, 0.15);
  transition: transform var(--transition-fast);
}

.product-tag:hover {
  transform: translateY(-1px);
  color: var(--clr-accent-hover);
}

.store-badge {
  font-weight: 500;
  opacity: 0.85;
}

.product-price {
  font-weight: 700;
}

/* =========================================================
   14. COMMENTS SYSTEM — JS-GENERATED
   ========================================================= */
.comments-drawer {
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  border-top: 1px solid var(--clr-border-light);
}

.comment-composer {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.comment-input {
  flex: 1;
  height: 38px;
  padding: 0 0.85rem;
  background-color: var(--clr-bg-page);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-full);
  color: var(--clr-text-main);
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.comment-input:focus {
  border-color: var(--clr-accent-primary);
  box-shadow: 0 0 0 3px var(--clr-accent-soft);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.comment-item {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.comment-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background-color: var(--clr-bg-subtle);
  color: var(--clr-text-muted);
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.comment-content {
  flex: 1;
  min-width: 0;
}

.comment-author-name {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--clr-text-main);
  margin-right: 0.4rem;
}

.comment-body {
  font-size: 0.875rem;
  color: var(--clr-text-main);
  line-height: 1.45;
  margin-top: 0.15rem;
}

.comment-meta {
  margin-top: 0.25rem;
}

.btn-delete-comment {
  font-size: 0.75rem;
  color: var(--clr-danger);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-weight: 600;
}

.btn-delete-comment:hover {
  text-decoration: underline;
}

/* =========================================================
   15. BATTLE CARD — JS-GENERATED COMPONENTS
   ========================================================= */
.battle-header-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--clr-accent-primary);
  background-color: var(--clr-accent-soft);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.battle-option {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--clr-border);
  background-color: var(--clr-bg-card);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.battle-option:hover {
  border-color: var(--clr-accent-primary);
  transform: translateY(-2px);
}

.battle-option.voted {
  border-color: var(--clr-accent-primary);
}

.battle-option.winner {
  border-color: var(--clr-accent-gold);
  box-shadow: 0 0 20px rgba(217, 119, 6, 0.15);
}

.battle-option-img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

.battle-option-info {
  padding: 0.85rem;
}

.battle-option-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--clr-text-main);
  display: block;
  margin-bottom: 0.5rem;
}

.battle-option-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--clr-text-muted);
  margin-top: 0.35rem;
}

.progress-bar-bg {
  height: 8px;
  background-color: var(--clr-border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--clr-accent-primary);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.winner-crown {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.battle-timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  background-color: var(--clr-accent-soft);
  color: var(--clr-accent-primary);
}

.battle-timer-badge.ended {
  background-color: var(--clr-bg-subtle);
  color: var(--clr-text-muted);
}

/* =========================================================
   16. CHALLENGE CARD — JS-GENERATED COMPONENTS
   ========================================================= */
.challenge-body {
  padding: 1.25rem;
}

.challenge-stage-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
}

.challenge-stage-tag.stage-submission {
  background-color: var(--clr-success-soft);
  color: var(--clr-success);
}

.challenge-stage-tag.stage-voting {
  background-color: var(--clr-accent-soft);
  color: var(--clr-accent-primary);
}

.challenge-stage-tag.stage-ended {
  background-color: var(--clr-bg-subtle);
  color: var(--clr-text-muted);
}

.badge-winner-gold {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.3);
}

/* =========================================================
   17. NOTIFICATIONS — JS-GENERATED
   ========================================================= */
.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast);
}

.notification-item:hover {
  background-color: var(--clr-bg-subtle);
}

.notification-item.unread {
  background-color: var(--clr-accent-soft);
  font-weight: 600;
}

/* =========================================================
   18. HIGHLIGHTS / PROFILE — JS-GENERATED
   ========================================================= */
.profile-card {
  text-align: center;
  padding: 1.5rem 1rem;
}

.profile-card .avatar {
  margin: 0 auto 0.75rem;
  width: 56px;
  height: 56px;
  font-size: 1.3rem;
}

.highlights-container {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.75rem 0 0.25rem;
  margin-top: 0.5rem;
  scrollbar-width: none;
}

.highlights-container::-webkit-scrollbar {
  display: none;
}

.highlight-circle-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  flex-shrink: 0;
}

.highlight-circle-img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--clr-accent-primary);
  padding: 2px;
}

.highlight-title {
  font-size: 0.7rem;
  color: var(--clr-text-muted);
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.highlight-gold {
  color: var(--clr-accent-gold) !important;
}

/* =========================================================
   19. LOADING SPINNER
   ========================================================= */
.loading-spinner {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--clr-text-muted);
  font-size: 0.9rem;
}

/* =========================================================
   20. RESPONSIVE BREAKPOINTS (390px, 430px, 768px, 1024px, 1440px)
   ========================================================= */
@media (max-width: 1024px) {
  .app-layout {
    grid-template-columns: 220px 1fr;
  }
  .sidebar-right {
    display: none;
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: 70px;
  }
  .app-layout {
    grid-template-columns: 1fr;
    max-width: 100%;
    width: 100%;
    padding: 0 1rem;
    margin-top: 0.75rem;
    gap: 1rem;
  }
  .sidebar-left {
    display: none;
  }
  .sidebar-right {
    display: none;
  }
  .nav-menu {
    display: none;
  }
  .nav-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.6rem 1rem;
  }
  .main-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .hero-banner {
    padding: 2rem 1.25rem;
    border-radius: var(--radius-lg);
  }
  .hero-title {
    font-size: 1.75rem;
  }
  .hero-subtitle {
    font-size: 0.95rem;
  }
  .card {
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-md);
  }
  .battle-grid {
    grid-template-columns: 1fr;
  }
  .battle-option-img {
    height: 240px;
  }
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .modal-box {
    max-width: 100%;
    width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 85vh;
    max-height: 85dvh;
    padding: 1.5rem;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .modal-box .form-group:last-of-type {
    margin-bottom: 0.5rem;
  }
  .modal-box .btn[type="submit"],
  .modal-box .modal-submit-sticky {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background-color: var(--clr-bg-card);
    padding-top: 0.75rem;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    margin-top: 0.5rem;
    border-top: 1px solid var(--clr-border-light);
  }
  .post-card {
    border-radius: var(--radius-md);
    padding: 1rem;
  }
  .hide-mobile {
    display: none !important;
  }
  .user-actions {
    gap: 0.4rem;
    flex-shrink: 1;
    justify-content: flex-end;
    max-width: 100%;
  }
  .user-actions .btn:not(.hide-mobile) {
    min-width: auto;
    height: 36px;
    padding: 0 0.6rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }
  .btn-icon-only {
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .btn-profile-header {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .search-bar-wrapper {
    display: none;
  }
}

@media (max-width: 430px) {
  .nav-container {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
  }
  .brand-logo span:not(.brand-icon) {
    font-size: 1rem;
  }
  .hero-title {
    font-size: 1.6rem;
  }
  .btn-lg {
    height: 46px;
    padding: 0 1.25rem;
    font-size: 0.9rem;
  }
  .app-layout {
    padding: 0 0.75rem;
  }
}

@media (max-width: 375px) {
  .nav-container {
    padding: 0.5rem 0.6rem;
    gap: 0.5rem;
  }
  .brand-logo span:not(.brand-icon) {
    font-size: 0.95rem;
  }
  .hero-banner {
    padding: 1.5rem 1rem;
  }
  .hero-title {
    font-size: 1.45rem;
  }
  .hero-subtitle {
    font-size: 0.875rem;
  }
  .btn {
    height: 40px;
    padding: 0 0.85rem;
    font-size: 0.85rem;
  }
  .app-layout {
    padding: 0 0.5rem;
  }
}

@media (max-width: 320px) {
  .brand-logo span:not(.brand-icon) {
    display: none;
  }
  .nav-container {
    padding: 0.4rem 0.5rem;
    gap: 0.4rem;
  }
  .app-layout {
    padding: 0 0.4rem;
  }
}

/* =========================================================
   BODY SCROLL LOCK — When modal/bottom-sheet is open
   ========================================================= */
body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* =========================================================
   BLOG / DERGİ — Editorial Content Styles
   ========================================================= */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.blog-card {
  background-color: var(--clr-bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--clr-border);
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
}

.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.blog-card-cover {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.blog-card-body {
  padding: 1.2rem;
}

.blog-category-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #FFFFFF;
  margin-bottom: 0.6rem;
}

.blog-card-title {
  font-family: var(--font-family-display);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--clr-text-main);
  margin-bottom: 0.5rem;
}

.blog-card-excerpt {
  font-size: 0.875rem;
  color: var(--clr-text-muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-meta {
  display: flex;
  gap: 0.8rem;
  font-size: 0.75rem;
  color: var(--clr-text-subtle);
}

/* Blog Article Detail */
.blog-article {
  max-width: 680px;
  margin: 0 auto;
}

.blog-article-cover {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
}

.blog-article-header {
  margin-bottom: 2rem;
}

.blog-article-title {
  font-family: var(--font-family-serif);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--clr-text-main);
  margin-bottom: 0.75rem;
}

.blog-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--clr-text-muted);
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--clr-border);
}

.blog-article-content {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--clr-text-main);
}

.blog-article-content h2 {
  font-family: var(--font-family-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--clr-text-main);
}

.blog-article-content p {
  margin-bottom: 1.25rem;
}

.blog-article-content ul {
  margin: 0.75rem 0 1.25rem 1.5rem;
}

.blog-article-content li {
  margin-bottom: 0.4rem;
  line-height: 1.6;
}

.blog-breadcrumb {
  display: flex;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--clr-text-subtle);
  margin-bottom: 1.5rem;
}

.blog-breadcrumb a {
  color: var(--clr-accent-primary);
}

/* =========================================================
   HOMEPAGE SECTIONS — Guest First-Visit Content
   ========================================================= */
.home-section {
  margin-bottom: 2rem;
  overflow: hidden;
  max-width: 100%;
}

.home-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.home-section-title {
  font-family: var(--font-family-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--clr-text-main);
}

.home-section-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--clr-accent-primary);
}

/* Featured Creators Horizontal Scroll */
.creators-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.5rem;
  scrollbar-width: none;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.creators-scroll::-webkit-scrollbar {
  display: none;
}

.creator-card {
  flex: 0 0 auto;
  width: 140px;
  scroll-snap-align: start;
  text-align: center;
  padding: 1rem 0.75rem;
  background-color: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
}

.creator-card .avatar {
  margin: 0 auto 0.5rem;
}

.creator-card-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--clr-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.creator-card-handle {
  font-size: 0.75rem;
  color: var(--clr-text-muted);
}

.creator-card-stat {
  font-size: 0.7rem;
  color: var(--clr-text-subtle);
  margin-top: 0.3rem;
}

/* CTA Section */
.cta-section {
  background: linear-gradient(135deg, var(--clr-accent-primary), var(--clr-accent-warm));
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  text-align: center;
  color: #FFFFFF;
}

.cta-section h2 {
  font-family: var(--font-family-serif);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.cta-section p {
  font-size: 0.95rem;
  opacity: 0.9;
  margin-bottom: 1.2rem;
}

.cta-section .btn {
  background-color: #FFFFFF;
  color: var(--clr-accent-primary);
  font-weight: 700;
}

/* Demo badge */
.demo-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--clr-warning-soft);
  color: var(--clr-warning);
  margin-left: 0.4rem;
  vertical-align: middle;
}

/* Blog responsive */
@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .blog-card-cover {
    height: 180px;
  }
  .blog-article-cover {
    height: 220px;
    border-radius: var(--radius-md);
  }
  .blog-article-title {
    font-size: 1.5rem;
  }
  .blog-article-content {
    font-size: 1rem;
  }
  .cta-section {
    padding: 2rem 1.25rem;
  }
  .cta-section h2 {
    font-size: 1.35rem;
  }
  .creator-card {
    width: 120px;
    padding: 0.75rem 0.5rem;
  }
}

@media (max-width: 375px) {
  .blog-article-title {
    font-size: 1.3rem;
  }
  .cta-section {
    padding: 1.5rem 1rem;
  }
  .cta-section h2 {
    font-size: 1.2rem;
  }
}

/* =========================================================
   SETTINGS & ACCOUNT PRIVACY (TASK 02)
   ========================================================= */
.settings-container {
  max-width: 680px;
  margin: 0 auto;
}

.settings-header {
  margin-bottom: 1.5rem;
}

.settings-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--clr-border);
  padding-bottom: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.settings-tab-btn {
  background: transparent;
  border: none;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--clr-text-muted);
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.settings-tab-btn.active,
.settings-tab-btn:hover {
  background: var(--clr-bg-subtle);
  color: var(--clr-accent-primary);
}

.settings-panel {
  display: none;
}

.settings-panel.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .25s;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .25s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--clr-accent-primary);
}

input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

/* =========================================================
   TASK 04: MULTI-PHOTO CAROUSEL & PREVIEW
   ========================================================= */

/* Media Preview Grid in Create Post Modal */
.media-preview-container {
  margin-top: 0.8rem;
  background: var(--clr-bg-subtle);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  padding: 0.8rem;
}

.media-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--clr-text-main);
}

.media-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
  gap: 0.6rem;
}

.media-preview-item {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--clr-border);
  background: #000;
}

.media-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-preview-badge {
  position: absolute;
  top: 3px;
  left: 3px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 4px;
  border-radius: 3px;
  z-index: 2;
}

.media-preview-actions {
  position: absolute;
  bottom: 3px;
  right: 3px;
  display: flex;
  gap: 2px;
  z-index: 2;
}

.media-preview-btn {
  background: rgba(0,0,0,0.75);
  color: #fff;
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.media-preview-btn:hover {
  background: var(--clr-accent-primary);
}

.media-preview-btn.btn-remove:hover {
  background: #e74c3c;
}

/* Feed & Detail Carousel */
.post-carousel-container {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 0.85rem 0;
  background-color: #000;
  border: 1px solid var(--clr-border-light);
  max-height: 540px;
  touch-action: pan-y pan-x;
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 540px;
  background: #000;
}

.carousel-slide img {
  width: 100%;
  max-height: 540px;
  object-fit: cover;
}

.carousel-counter-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
  z-index: 2;
  pointer-events: none;
}

.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 2;
  pointer-events: none;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transition: all 0.2s ease;
}

.carousel-dot.active {
  background: #fff;
  width: 14px;
  border-radius: 4px;
}

.carousel-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: background 0.2s ease;
}

.carousel-nav-btn:hover {
  background: rgba(0,0,0,0.85);
}

.carousel-prev-btn { left: 8px; }
.carousel-next-btn { right: 8px; }

/* Grid Multi-Media Stack Badge */
.grid-media-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 2;
}

/* =========================================================
   TASK 05 — MOBILE SEARCH OVERLAY & FULL SEARCH PAGE
   ========================================================= */
.search-container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0.5rem 0;
  box-sizing: border-box;
}

.search-header-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
  position: sticky;
  top: 0;
  background: var(--clr-bg-main);
  padding: 0.5rem 0;
  z-index: 10;
}

.search-back-btn {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-full);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--clr-text-main);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.search-back-btn:hover {
  background: var(--clr-bg-subtle);
  border-color: var(--clr-accent-primary);
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.search-input-icon {
  position: absolute;
  left: 12px;
  color: var(--clr-text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}

.search-page-input {
  width: 100%;
  height: 44px;
  padding: 0 2.4rem 0 2.2rem;
  font-size: 1rem; /* 16px to prevent iOS auto-zoom */
  border-radius: var(--radius-full);
  border: 1.5px solid var(--clr-border);
  background: var(--clr-bg-card);
  color: var(--clr-text-main);
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-page-input:focus {
  border-color: var(--clr-accent-primary);
  box-shadow: 0 0 0 3px var(--clr-accent-soft);
}

.search-clear-btn {
  position: absolute;
  right: 10px;
  background: var(--clr-bg-subtle);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--clr-text-muted);
  cursor: pointer;
}

.search-section {
  margin-bottom: 1.5rem;
}

.search-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--clr-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.search-result-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem;
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border-light);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
  text-decoration: none;
  color: inherit;
}

.search-result-card:hover {
  border-color: var(--clr-accent-primary);
  transform: translateY(-1px);
}

.search-user-info {
  flex: 1;
  min-width: 0;
}

.search-user-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--clr-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.search-user-username {
  font-size: 0.8rem;
  color: var(--clr-text-muted);
}

.search-hashtag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-full);
  margin: 0 0.5rem 0.5rem 0;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--clr-accent-primary);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.search-hashtag-pill:hover {
  background: var(--clr-accent-soft);
  border-color: var(--clr-accent-primary);
}

.recent-searches-box {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border-light);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.recent-search-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  background: var(--clr-bg-subtle);
  border: 1px solid var(--clr-border-light);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--clr-text-main);
  margin: 0 0.4rem 0.4rem 0;
  cursor: pointer;
}

.recent-search-pill:hover {
  border-color: var(--clr-accent-primary);
  color: var(--clr-accent-primary);
}

.search-hero-entry {
  background: linear-gradient(135deg, var(--clr-bg-card), var(--clr-bg-subtle));
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-full);
  padding: 0.75rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--clr-text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  margin-bottom: 1.25rem;
  transition: border-color var(--transition-fast);
}

.search-hero-entry:hover {
  border-color: var(--clr-accent-primary);
  color: var(--clr-accent-primary);
}

/* =========================================================
   TASK 07 — STORY-STYLE HIGHLIGHT VIEWER STYLES
   ========================================================= */
.story-viewer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}

.story-viewer-overlay.active {
  display: flex !important;
}

.story-viewer-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  max-height: 900px;
  background: #000;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.story-progress-bar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
  z-index: 20;
}

.story-progress-segment {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 2px;
  overflow: hidden;
}

.story-progress-fill {
  height: 100%;
  width: 0%;
  background: #ffffff;
  transition: width 0.1s linear;
}

.story-progress-segment.completed .story-progress-fill {
  width: 100%;
}

.story-header {
  position: absolute;
  top: 24px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.story-owner-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.story-owner-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #fff;
}

.story-owner-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.story-owner-sub {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
}

.story-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.story-owner-action-btn {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  border-radius: var(--radius-full);
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.story-close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.4rem;
}

.story-media-stage {
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #000;
}

.story-media-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
}

.story-tap-zone {
  position: absolute;
  top: 60px;
  bottom: 0;
  z-index: 100;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.01);
  display: block;
}

.story-tap-left {
  left: 0;
  width: 30%;
  height: calc(100% - 60px);
  min-height: 300px;
}

.story-tap-right {
  right: 0;
  width: 70%;
  height: calc(100% - 60px);
  min-height: 300px;
}

/* Profile Highlight Horizontal Row */
.highlights-row {
  display: flex;
  gap: 1.2rem;
  overflow-x: auto;
  padding: 0.5rem 0 1rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.highlight-circle-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
  width: 72px;
}

.highlight-circle-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  padding: 2.5px;
  background: linear-gradient(135deg, var(--clr-accent-primary), #e65c00);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
}

.highlight-circle-item:hover .highlight-circle-ring {
  transform: scale(1.05);
}

.highlight-circle-cover {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--clr-bg-subtle);
  border: 2px solid var(--clr-bg-card);
}

.highlight-circle-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--clr-text-main);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 72px;
}

/* =========================================================
   TASK 09 — SKELETON LOADERS, EMPTY/ERROR STATES, TOASTS & FALLBACKS
   ========================================================= */

/* 1. Layout Stability */
#feed-container, main.main-content {
  min-height: 60vh;
}

/* 2. Shimmer Skeleton System */
@keyframes cv-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-shimmer {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: cv-shimmer 1.5s infinite linear;
  border-radius: var(--radius-sm);
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-shimmer {
    animation: none;
    background: #e2e8f0;
  }
}

.skeleton-card {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.skeleton-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.skeleton-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.skeleton-line {
  height: 14px;
  border-radius: 4px;
}

.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-20 { width: 20%; }

.skeleton-media-block {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.skeleton-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.5rem;
}

/* Profile Skeleton */
.skeleton-profile-header {
  text-align: center;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.skeleton-profile-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.skeleton-grid-item {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
}

/* 3. Empty & Error States */
.empty-state-card, .error-state-card {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 3rem 1.5rem;
  text-align: center;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}

.empty-state-icon, .error-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: inline-block;
  line-height: 1;
}

.empty-state-title, .error-state-title {
  font-family: var(--font-family-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--clr-text-main);
  margin-bottom: 0.5rem;
}

.empty-state-desc, .error-state-desc {
  color: var(--clr-text-muted);
  font-size: 0.95rem;
  max-width: 480px;
  margin: 0 auto 1.5rem;
  line-height: 1.5;
}

.empty-state-actions, .error-state-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* 4. Broken Media Fallback */
.media-broken-fallback {
  width: 100%;
  min-height: 220px;
  background: var(--clr-bg-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--clr-text-muted);
  border: 1px dashed var(--clr-border);
  padding: 2rem;
}

.media-broken-icon {
  font-size: 2rem;
}

.media-broken-text {
  font-size: 0.85rem;
  font-weight: 500;
}

/* 5. Mobile-Safe Toast System */
#toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
  width: calc(100% - 2rem);
  max-width: 420px;
}

@media (min-width: 769px) {
  #toast-container {
    bottom: 30px;
    right: 30px;
    left: auto;
    transform: none;
  }
}

.toast {
  background: #171717;
  color: #FFFFFF;
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  pointer-events: auto;
  animation: toast-slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 4px solid var(--clr-accent-primary);
}

.toast.toast-success {
  border-left-color: #10b981;
}

.toast.toast-error {
  border-left-color: #ef4444;
}

.toast.toast-info {
  border-left-color: var(--clr-accent-primary);
}

@keyframes toast-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Indeterminate Progress Loader for Forms */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

.btn-loading::after {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
  margin-left: 0.5rem;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

