/* ============================================================
   Delia Theme - Enhancement Styles v2.1.0
   Share Buttons, PWA Banner, Cookie Notice, Admin Bar
   ============================================================ */

/* --- Share Buttons --- */
.delia-share-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.delia-share-group a,
.delia-share-group button {
    transition: transform 0.2s, box-shadow 0.2s;
}
.delia-share-group a:hover,
.delia-share-group button:hover {
    transform: scale(1.12);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* --- Cookie Consent Banner --- */
#delia-cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10,15,30,0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 20px 28px;
    max-width: 600px;
    width: calc(100% - 40px);
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 99999;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: slideUpCookie 0.4s ease;
    color: #f1f5f9;
    font-size: 14px;
}
@keyframes slideUpCookie {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
#delia-cookie-banner p { margin: 0; line-height: 1.5; flex: 1; }
#delia-cookie-banner .cookie-btns { display: flex; gap: 10px; flex-shrink: 0; }
#delia-cookie-accept {
    background: #1a73e8;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}
#delia-cookie-accept:hover { background: #1557b0; }
#delia-cookie-decline {
    background: transparent;
    color: rgba(241,245,249,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
#delia-cookie-decline:hover { border-color: rgba(255,255,255,0.3); color: #f1f5f9; }
@media (max-width: 600px) {
    #delia-cookie-banner { flex-direction: column; text-align: center; gap: 14px; }
    #delia-cookie-banner .cookie-btns { width: 100%; justify-content: center; }
}

/* --- PWA Install Banner --- */
#delia-pwa-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a73e8, #0052a3);
    color: #fff;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 99998;
    font-size: 14px;
    box-shadow: 0 2px 20px rgba(26,115,232,0.4);
    animation: slideDownBanner 0.3s ease;
}
@keyframes slideDownBanner {
    from { transform: translateY(-100%); }
    to   { transform: translateY(0); }
}
#delia-pwa-banner button {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}
#delia-pwa-banner button:hover { background: rgba(255,255,255,0.35); }
#delia-pwa-banner .pwa-close {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 20px;
    padding: 0 4px;
    line-height: 1;
    cursor: pointer;
    margin-left: 8px;
}
#delia-pwa-banner .pwa-close:hover { color: #fff; }


/* --- Lazy Load Images --- */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.4s ease;
}
img[loading="lazy"].loaded {
    opacity: 1;
}

/* --- Reading Progress Bar --- */
#delia-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #1a73e8, #06b6d4, #8b5cf6);
    z-index: 99997;
    transition: width 0.1s linear;
}

/* --- Notification Toast --- */
.delia-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    min-width: 280px;
    max-width: 400px;
    background: rgba(10,15,30,0.95);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 14px 18px;
    color: #f1f5f9;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 99999;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    animation: toastIn 0.3s ease;
    backdrop-filter: blur(10px);
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}
.delia-toast.success { border-left: 3px solid #10b981; }
.delia-toast.error   { border-left: 3px solid #ef4444; }
.delia-toast.info    { border-left: 3px solid #1a73e8; }
.delia-toast .toast-close {
    margin-left: auto;
    cursor: pointer;
    opacity: 0.5;
    background: none;
    border: none;
    color: #f1f5f9;
    font-size: 18px;
    padding: 0;
}
.delia-toast .toast-close:hover { opacity: 1; }

/* --- Smooth Page Transitions --- */
.delia-page-transition {
    animation: fadeInPage 0.3s ease;
}
@keyframes fadeInPage {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Social Proof Widget --- */
.delia-social-proof {
    background: var(--d-bg-card, #0d1220);
    border: 1px solid var(--d-border, rgba(255,255,255,0.08));
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--d-text-muted, rgba(241,245,249,0.5));
}
.delia-social-proof .avatars {
    display: flex;
}
.delia-social-proof .avatars img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--d-bg-card, #0d1220);
    margin-left: -8px;
}
.delia-social-proof .avatars img:first-child { margin-left: 0; }

/* --- Responsive enhancements --- */
@media (max-width: 768px) {
    .delia-post-actions {
        flex-direction: column;
        align-items: flex-start !important;
    }
    .delia-share-group {
        margin-left: 0 !important;
        width: 100%;
    }
}

/* --- Print styles --- */
@media print {
    .delia-header, .delia-footer, #delia-cookie-banner { display: none !important; }
    .entry-content { font-size: 12pt; line-height: 1.6; }
    a { color: #000 !important; text-decoration: underline !important; }
    .delia-post-actions { display: none !important; }
}


  /* ============================================================
     MOBILE RESPONSIVE FIXES — Forum, User Panel, General
     ============================================================ */

  /* --- Global box-sizing fix --- */
  *, *::before, *::after { box-sizing: border-box; }

  /* --- Prevent horizontal overflow --- */
  html, body {
      overflow-x: hidden;
      max-width: 100vw;
  }

  /* --- Forum responsive fixes --- */
  @media (max-width: 768px) {
      /* bbPress / forum tables */
      .bbp-body,
      .bbp-forum-content,
      .bbp-topics-front,
      #bbpress-forums {
          width: 100% !important;
          overflow-x: auto !important;
      }

      #bbpress-forums li.bbp-header,
      #bbpress-forums li.bbp-body,
      #bbpress-forums li.bbp-footer {
          padding: 8px 12px !important;
      }

      #bbpress-forums ul.bbp-forums,
      #bbpress-forums ul.bbp-topics,
      #bbpress-forums ul.bbp-replies {
          padding: 0 !important;
      }

      /* Forum topic/reply meta — stack vertically */
      .bbp-topic-meta,
      .bbp-reply-meta {
          display: flex !important;
          flex-wrap: wrap !important;
          gap: 4px 12px !important;
          font-size: 12px !important;
      }

      /* Forum topic title + stats row */
      #bbpress-forums li.bbp-header span,
      .bbp-forum-info,
      .bbp-forum-title {
          max-width: 100% !important;
          word-break: break-word !important;
      }

      /* Forum last activity column — hide on small screens */
      .bbp-topic-freshness,
      .bbp-reply-count,
      .bbp-voice-count {
          display: none !important;
      }

      /* Forum search bar */
      #bbp-search-form {
          width: 100% !important;
      }
      #bbp-search-form input[type="text"] {
          width: 100% !important;
          font-size: 16px !important; /* Prevent iOS zoom */
      }

      /* Forum reply form */
      #new-reply,
      #bbp-your-profile,
      .bbp-template-notice {
          width: 100% !important;
          padding: 12px !important;
      }

      /* Forum reply/topic text area */
      #bbp_topic_content,
      #bbp_reply_content,
      .wp-editor-area {
          width: 100% !important;
          font-size: 16px !important;
      }

      /* Forum post author column */
      .bbp-reply-author,
      .bbp-topic-author {
          width: 60px !important;
          min-width: 60px !important;
      }

      /* Forum breadcrumbs */
      .bbp-breadcrumb {
          font-size: 12px !important;
          word-break: break-all !important;
      }

      /* Delia forum wrapper */
      .delia-forum-wrap,
      .delia-forum-content {
          padding: 12px !important;
          width: 100% !important;
      }
  }

  /* --- User panel / dashboard mobile fixes --- */
  @media (max-width: 900px) {
      .delia-user-panel {
          grid-template-columns: 1fr !important;
          display: block !important;
      }

      .delia-user-panel-sidebar {
          position: static !important;
          height: auto !important;
          width: 100% !important;
          border-right: none !important;
          border-bottom: 1px solid rgba(148,163,184,0.18) !important;
      }

      .delia-user-panel-main {
          padding: 16px !important;
      }
  }

  /* --- Account settings (user-settings.php) mobile --- */
  @media (max-width: 860px) {
      .delia-account-settings {
          grid-template-columns: 1fr !important;
          display: block !important;
      }

      .delia-account-sidebar {
          position: static !important;
          width: 100% !important;
          border-right: none !important;
          padding-bottom: 16px !important;
          border-bottom: 1px solid rgba(148,163,184,0.12) !important;
      }

      .delia-account-tabs {
          flex-direction: row !important;
          flex-wrap: wrap !important;
          gap: 6px !important;
      }

      .delia-account-tabs button {
          flex: 0 0 auto !important;
          padding: 8px 12px !important;
          font-size: 13px !important;
      }

      .delia-account-grid.two {
          grid-template-columns: 1fr !important;
      }

      .delia-account-main {
          padding: 16px !important;
      }
  }

  /* --- Dashboard grid mobile --- */
  @media (max-width: 768px) {
      .delia-dashboard-grid,
      [style*="grid-template-columns: repeat(4"] {
          display: grid !important;
          grid-template-columns: 1fr 1fr !important;
      }

      .delia-dashboard-grid-3,
      [style*="grid-template-columns: repeat(3"] {
          display: grid !important;
          grid-template-columns: 1fr !important;
      }

      /* Quick actions grid */
      .delia-quick-actions-grid {
          grid-template-columns: 1fr 1fr !important;
      }

      /* Chat mobile fixes */
      .delia-chat-container {
          flex-direction: column !important;
          height: auto !important;
      }

      .delia-chat-sidebar {
          width: 100% !important;
          height: 200px !important;
          overflow-y: auto !important;
      }

      /* Input fields — prevent iOS zoom */
      input[type="text"],
      input[type="email"],
      input[type="password"],
      input[type="search"],
      input[type="tel"],
      input[type="url"],
      select,
      textarea {
          font-size: 16px !important;
      }
  }

  /* --- Passkey panel mobile --- */
  @media (max-width: 480px) {
      .delia-pk-panel {
          bottom: 0 !important;
          right: 0 !important;
          left: 0 !important;
          width: 100% !important;
          border-radius: 22px 22px 0 0 !important;
      }

      .delia-pk-fab {
          bottom: 80px !important;
          right: 16px !important;
      }
  }

  /* --- Mega menu mobile (already handled but ensure nav collapse) --- */
  @media (max-width: 900px) {
      .delia-mega-nav {
          display: none !important;
      }

      .delia-nav-toggle {
          display: flex !important;
      }
  }
  