/* Post Detail Page - Specific Styles
 * Grid layout, sidebar widgets, mobile accordion = community.css (co-loaded)
 */

/* Top Navigation Bar (card style) */
.pd-top-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: linear-gradient(160deg, rgba(20, 30, 48, 0.95) 0%, rgba(12, 18, 30, 0.9) 100%);
    border: 1px solid rgba(0, 212, 170, 0.15);
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    margin-top: 10px;
    margin-bottom: 12px;
}

/* Back link */
.pd-back-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    color: #00d4aa;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.pd-back-link:hover {
    background: rgba(0, 212, 170, 0.1);
    transform: translateX(-2px);
}

/* Breadcrumb */
.pd-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}
.pd-breadcrumb a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.15s;
}
.pd-breadcrumb a:hover {
    color: #00d4aa;
}
.pd-breadcrumb svg {
    opacity: 0.4;
    flex-shrink: 0;
}
.pd-breadcrumb > span {
    color: rgba(255, 255, 255, 0.7);
}

/* ========== POST CARD ========== */
.pd-post-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
}

.pd-pinned-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #00d4aa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* Post Header */
.pd-post-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}
.pd-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
}
.pd-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pd-post-meta {
    flex: 1;
    min-width: 0;
}
.pd-meta-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.pd-username {
    font-weight: 600;
    font-size: 15px;
    color: #fff;
}
.pd-meta-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
}
.pd-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}
.pd-edited {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
}

/* Follow button on post */
.pd-follow-btn {
    background: transparent;
    border: 1px solid #00d4aa;
    color: #00d4aa;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.pd-follow-btn:hover {
    background: rgba(0, 212, 170, 0.1);
}
.pd-follow-btn.following {
    background: rgba(0, 212, 170, 0.15);
    border-color: rgba(0, 212, 170, 0.4);
    color: rgba(0, 212, 170, 0.8);
}

/* Quoted Post */
.pd-quoted-post {
    background: rgba(255, 255, 255, 0.04);
    border-left: 3px solid rgba(0, 212, 170, 0.3);
    border-radius: 0 8px 8px 0;
    padding: 10px 14px;
    margin-bottom: 14px;
}
.pd-quote-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 4px;
}
.pd-quote-content {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
    margin: 0;
}

/* Post Content */
.pd-post-content {
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
    word-wrap: break-word;
    overflow-wrap: break-word;
    margin-bottom: 16px;
}
.pd-post-content a {
    color: #00d4aa;
    text-decoration: none;
}
.pd-post-content a:hover {
    text-decoration: underline;
}

/* Media Grid */
.pd-media-grid {
    display: grid;
    gap: 8px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}
.pd-media-1 { grid-template-columns: 1fr; }
.pd-media-2 { grid-template-columns: 1fr 1fr; }
.pd-media-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.pd-media-3 .pd-media-item:first-child { grid-row: 1 / 3; }
.pd-media-4 { grid-template-columns: 1fr 1fr; }
.pd-media-item {
    overflow: hidden;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
}
.pd-media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-height: 400px;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.pd-media-item img:hover {
    transform: scale(1.02);
}

/* Action Bar */
.pd-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-wrap: wrap;
}
.pd-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}
.pd-action-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.8);
}
.pd-action-btn.active {
    color: #00d4aa;
}
.pd-action-btn.active svg {
    color: #00d4aa;
}
.pd-action-btn.bookmarked {
    color: #f59e0b;
}
.pd-action-btn.bookmarked svg {
    color: #f59e0b;
}
.pd-action-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0 4px;
}
.pd-symbol-link {
    color: #00d4aa !important;
    font-weight: 600;
}
.pd-share-btn {
    margin-left: auto;
}

/* Small action buttons (replies) */
.pd-action-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* ========== REPLY SECTION ========== */
.pd-reply-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 20px 24px;
}

.pd-replies-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 16px 0;
}
.pd-reply-count {
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.4);
}

/* Reply Form */
.pd-reply-form {
    margin-bottom: 20px;
}
.pd-reply-form textarea {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}
.pd-reply-form textarea:focus {
    outline: none;
    border-color: #00d4aa;
    background: rgba(0, 212, 170, 0.04);
}
.pd-reply-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}
.pd-reply-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}
.pd-char-count {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
}
.pd-reply-submit {
    background: #00d4aa;
    color: #0a0e17;
    border: none;
    padding: 8px 24px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.pd-reply-submit:hover:not(:disabled) {
    background: #00e6b8;
    transform: translateY(-1px);
}
.pd-reply-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Login Prompt */
.pd-login-prompt {
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}
.pd-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #00d4aa, #00b894);
    color: #0a0e17;
    text-decoration: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}
.pd-login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

/* No Replies */
.pd-no-replies {
    text-align: center;
    padding: 32px 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
}

/* ========== REPLY ITEMS ========== */
.pd-replies-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.pd-reply-item {
    padding: 16px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.pd-reply-item:first-child {
    border-top: none;
}

.pd-reply-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.pd-reply-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
}
.pd-reply-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pd-reply-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.pd-reply-username {
    font-weight: 600;
    font-size: 13px;
    color: #fff;
}
.pd-reply-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
}
.pd-reply-body {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    padding-left: 42px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.pd-reply-body a {
    color: #00d4aa;
    text-decoration: none;
}
.pd-reply-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-left: 42px;
    margin-top: 6px;
}

/* Shared badges (from community.css, also used here) */
.pd-post-card .pro-badge,
.pd-reply-item .pro-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #000;
    font-size: 9px;
    font-weight: 700;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.pd-post-card .reputation-badge,
.pd-reply-item .reputation-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    font-size: 9px;
    font-weight: 700;
    border-radius: 4px;
    color: #fff;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.pd-post-card .symbol-badge,
.pd-reply-item .symbol-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: rgba(0, 212, 170, 0.12);
    color: #00d4aa;
    font-size: 11px;
    font-weight: 700;
    border-radius: 6px;
    text-decoration: none;
    letter-spacing: 0.5px;
}
.pd-post-card .symbol-badge:hover {
    background: rgba(0, 212, 170, 0.2);
}

/* Success toast for copy link */
.pd-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 212, 170, 0.95);
    color: #0a0e17;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    z-index: 9999;
    transition: transform 0.3s ease;
    pointer-events: none;
}
.pd-toast.visible {
    transform: translateX(-50%) translateY(0);
}

/* ========== RIGHT SIDEBAR WIDGET ENHANCEMENT ========== */
.post-detail-layout .community-right-sidebar .sidebar-widget {
    background: linear-gradient(160deg, rgba(20, 30, 48, 0.95) 0%, rgba(12, 18, 30, 0.9) 100%) !important;
    border: 1px solid rgba(0, 212, 170, 0.15) !important;
    border-radius: 14px !important;
    padding: 18px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
    margin-bottom: 12px !important;
}
.post-detail-layout .community-right-sidebar .sidebar-widget:hover {
    border-color: rgba(0, 212, 170, 0.3) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 212, 170, 0.1) !important;
}
.post-detail-layout .community-right-sidebar .widget-header {
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(0, 212, 170, 0.1);
}
.post-detail-layout .community-right-sidebar .widget-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
}
.post-detail-layout .community-right-sidebar .widget-icon {
    color: #00d4aa;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
    .post-detail-layout .community-right-sidebar {
        display: none;
    }
    .community-mobile-widgets {
        display: block;
    }
}
@media (max-width: 900px) {
    .post-detail-layout .community-left-nav {
        display: none;
    }
    .pd-post-card {
        padding: 16px;
        border-radius: 12px;
    }
    .pd-reply-section {
        padding: 16px;
        border-radius: 12px;
    }
    .pd-avatar {
        width: 40px;
        height: 40px;
    }
    .pd-post-content {
        font-size: 14px;
    }
    .pd-reply-body {
        padding-left: 0;
    }
    .pd-reply-actions {
        padding-left: 0;
    }
    .pd-actions {
        gap: 2px;
    }
    .pd-action-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    .pd-action-btn span:not(:empty) {
        display: none;
    }
    .pd-action-btn svg + span:not(:empty) {
        display: inline;
    }
    .pd-share-btn span {
        display: none !important;
    }
}

/* Avatar placeholder shared */
.pd-avatar .avatar-placeholder,
.pd-reply-avatar .avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.2), rgba(0, 212, 170, 0.1));
    color: #00d4aa;
    font-weight: 700;
    font-size: 16px;
}
.pd-reply-avatar .avatar-placeholder {
    font-size: 12px;
}

/* === TERM LINKS (education article cross-links in forum posts) === */
.pd-post-content a.term-link,
.pd-reply-body a.term-link {
    color: #60a5fa;
    text-decoration: none;
    border-bottom: 1px dashed rgba(96, 165, 250, 0.4);
    transition: border-color 0.2s, background 0.2s;
}
.pd-post-content a.term-link:hover,
.pd-reply-body a.term-link:hover {
    border-bottom-style: solid;
    border-bottom-color: rgba(96, 165, 250, 0.7);
    background: rgba(96, 165, 250, 0.08);
}
