/**
 * Technical Courseware & Document Styles
 */

/* Portal Wrapper */
.bridge-doc-portal-wrapper,
.bridge-doc-detail-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px 60px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #2c3e50;
    box-sizing: border-box;
    overflow-x: clip;
}

/* Breadcrumbs */
.bridge-doc-breadcrumbs {
    font-size: 13px;
    color: #888;
    margin-bottom: 24px;
}
.bridge-doc-breadcrumbs a {
    color: #555;
    text-decoration: none;
}
.bridge-doc-breadcrumbs a:hover {
    color: #e65100;
}
.bridge-doc-breadcrumbs .sep {
    margin: 0 8px;
    color: #ccc;
}
.bridge-doc-breadcrumbs .current {
    color: #222;
    font-weight: 500;
}

/* Hero Header in Portal */
.bridge-doc-portal-hero {
    text-align: center;
    background: linear-gradient(135deg, #1a2a3a 0%, #0d1b2a 100%);
    border-radius: 12px;
    padding: 45px 24px;
    color: #fff;
    margin-bottom: 35px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.08);
}
.bridge-hero-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 152, 0, 0.2);
    color: #ffb74d;
    border: 1px solid rgba(255, 152, 0, 0.4);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}
.bridge-hero-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px;
    color: #ffffff;
}
.bridge-hero-subtitle {
    font-size: 15px;
    color: #b0bec5;
    max-width: 720px;
    margin: 0 auto 28px;
    line-height: 1.6;
}

/* Search Form */
.bridge-doc-search-form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    gap: 8px;
}
.bridge-search-input {
    flex: 1;
    height: 46px;
    padding: 0 16px;
    border-radius: 6px;
    border: 1px solid #ced4da;
    font-size: 14px;
    outline: none;
    background: #fff;
    color: #333;
}
.bridge-search-input:focus {
    border-color: #ff9800;
}
.bridge-search-btn {
    height: 46px;
    padding: 0 24px;
    background: #ff9800;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.bridge-search-btn:hover {
    background: #f57c00;
}

/* Filter Section */
.bridge-doc-filter-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 30px;
}
.bridge-filter-group {
    display: flex;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px dashed #edf2f7;
}
.bridge-filter-group:last-child {
    border-bottom: none;
}
.group-label {
    width: 85px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    padding-top: 6px;
    flex-shrink: 0;
}
.group-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}
.filter-pill {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    color: #475569;
    text-decoration: none;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.15s ease;
}
.filter-pill:hover {
    color: #ff9800;
    border-color: #ffb74d;
}
.filter-pill.active {
    background: #ff9800;
    color: #fff;
    border-color: #ff9800;
    font-weight: 600;
}
.meeting-filter-group {
    align-items: flex-start;
}
.meeting-pills-wrap {
    flex: 1;
    max-height: 72px; /* strictly limit meeting filter badges to at most 2 rows */
    overflow: hidden;
}
.meeting-pills .filter-pill {
    font-size: 12px;
    line-height: 1.4;
}

.bridge-filter-subbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
    font-size: 13px;
    color: #64748b;
}
.sort-btn {
    margin-left: 8px;
    padding: 4px 10px;
    border-radius: 4px;
    color: #64748b;
    text-decoration: none;
}
.sort-btn.active {
    color: #ff9800;
    font-weight: 700;
}

/* Cards Grid */
.bridge-doc-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 22px;
}
.bridge-doc-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.bridge-doc-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.06);
    border-color: #ffb74d;
}
.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.fmt-badge {
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #ff9800;
}
.fmt-pdf { background: #e53935; }
.fmt-word { background: #1e88e5; }
.promo-badge {
    padding: 2px 6px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}
.card-clicks {
    margin-left: auto;
    font-size: 12px;
    color: #94a3b8;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
    margin: 0 0 10px;
    flex-grow: 1;
}
.card-title a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.15s;
}
.card-title a:hover {
    color: #e65100;
}
.card-meeting {
    font-size: 12px;
    color: #64748b;
    background: #f8fafc;
    padding: 6px 10px;
    border-radius: 4px;
    margin-bottom: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}
.card-price .price-val {
    font-size: 18px;
    font-weight: 700;
    color: #e65100;
}
.card-price .price-free {
    font-size: 16px;
    font-weight: 700;
    color: #2e7d32;
}
.card-price .price-old {
    font-size: 12px;
    color: #94a3b8;
    margin-left: 4px;
}
.card-action-btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    background: #f8fafc;
    color: #334155;
    border: 1px solid #cbd5e1;
    text-decoration: none;
    transition: all 0.2s;
}
.card-action-btn:hover {
    background: #ff9800;
    color: #fff;
    border-color: #ff9800;
}

/* Detail Page Layout */
.bridge-doc-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 35px;
    align-items: start;
}
.bridge-doc-main-col {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 35px;
    min-width: 0;
    box-sizing: border-box;
}
.bridge-doc-side-col {
    min-width: 0;
    box-sizing: border-box;
}
.bridge-doc-format-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: #ff9800;
    margin-bottom: 12px;
}
.bridge-doc-format-badge.format-pdf { background: #e53935; }
.bridge-doc-format-badge.format-word { background: #1e88e5; }

.bridge-doc-title {
    font-size: 26px;
    font-weight: 700;
    color: #1a202c;
    line-height: 1.4;
    margin: 0 0 16px;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.bridge-doc-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    font-size: 13px;
    color: #718096;
    padding-bottom: 20px;
    border-bottom: 1px solid #edf2f7;
    margin-bottom: 24px;
}

/* Meeting Origin Card */
.bridge-doc-meeting-card {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}
.bridge-doc-meeting-icon {
    font-size: 24px;
}
.bridge-doc-meeting-info {
    flex: 1;
}
.bridge-doc-meeting-label {
    display: block;
    font-size: 11px;
    color: #166534;
    font-weight: 600;
    text-transform: uppercase;
}
.bridge-doc-meeting-title {
    font-size: 14px;
    font-weight: 600;
    color: #14532d;
}
.bridge-doc-meeting-link {
    font-size: 13px;
    color: #15803d;
    text-decoration: none;
    font-weight: 600;
}
.bridge-doc-meeting-link:hover {
    text-decoration: underline;
}

/* Summary Box */
.bridge-doc-section-title {
    font-size: 17px;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 14px;
    padding-left: 10px;
    border-left: 4px solid #ff9800;
}
.bridge-doc-summary-content {
    font-size: 15px;
    line-height: 1.8;
    color: #4a5568;
    margin-bottom: 30px;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.bridge-doc-summary-content img {
    max-width: 100%;
    height: auto;
}
.bridge-doc-summary-content table,
.bridge-doc-summary-content pre {
    max-width: 100%;
    overflow-x: auto;
    display: block;
}
.bridge-doc-summary-content p {
    margin-bottom: 12px;
}
.bridge-doc-summary-content .empty-tip {
    color: #a0aec0;
    font-style: italic;
}

/* Tags */
.bridge-doc-tags-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 0;
    border-top: 1px dashed #e2e8f0;
    margin-bottom: 30px;
}
.bridge-doc-tags-row .tag-label {
    font-size: 13px;
    color: #718096;
}
.bridge-doc-tag-pill {
    padding: 3px 10px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 12px;
    font-size: 12px;
    text-decoration: none;
}
.bridge-doc-tag-pill:hover {
    background: #ff9800;
    color: #fff;
}

/* Related Box */
.bridge-doc-related-box {
    margin-top: 25px;
}
.bridge-doc-related-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.bridge-doc-related-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 6px;
    text-decoration: none;
    gap: 12px;
    min-width: 0;
    transition: background 0.15s;
}
.bridge-doc-related-item:hover {
    background: #f1f5f9;
}
.rd-fmt {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #ff9800;
    flex-shrink: 0;
}
.rd-fmt-pdf { background: #e53935; }
.rd-title {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rd-price {
    font-size: 13px;
    color: #e65100;
    font-weight: 600;
    flex-shrink: 0;
}

/* Right Action Card */
.bridge-doc-action-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
.sticky-sidebar {
    position: sticky;
    top: 30px;
}
.bridge-doc-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 18px;
}
.bridge-doc-card-badge {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}
.bridge-doc-card-price .price-val {
    font-size: 28px;
    font-weight: 800;
    color: #e65100;
}
.bridge-doc-card-price .free-text {
    font-size: 22px;
    font-weight: 800;
    color: #2e7d32;
}
.bridge-doc-card-price .del-price {
    font-size: 13px;
    color: #94a3b8;
    margin-left: 6px;
}

.bridge-doc-privilege-status {
    margin-bottom: 20px;
}
.status-box {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
}
.status-vip {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #b45309;
    font-weight: 600;
}
.status-free {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
    font-weight: 600;
}
.status-paid {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
    font-weight: 600;
}
.status-locked {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

/* Action Buttons */
.bridge-doc-action-buttons {
    margin-bottom: 24px;
}
.bridge-doc-btn {
    width: 100%;
    display: block;
    text-align: center;
    padding: 14px 16px;
    border-radius: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: transform 0.15s, box-shadow 0.15s;
}
.bridge-doc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.bridge-doc-btn-download {
    background: #2e7d32;
    color: #fff;
}
.bridge-doc-btn-download .btn-icon {
    font-size: 18px;
    margin-right: 6px;
}
.bridge-doc-btn-download .btn-text {
    font-size: 16px;
    font-weight: 700;
    display: inline;
}
.bridge-doc-btn-download .btn-sub {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,0.85);
    margin-top: 4px;
}

.bridge-doc-btn-buy {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: #fff;
}
.bridge-doc-btn-buy .btn-icon {
    font-size: 18px;
    margin-right: 6px;
}
.bridge-doc-btn-buy .btn-text {
    font-size: 16px;
    font-weight: 700;
    display: inline;
}
.bridge-doc-btn-buy .btn-sub {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,0.9);
    margin-top: 4px;
}

/* Guarantee */
.bridge-doc-guarantee-list {
    border-top: 1px solid #f1f5f9;
    padding-top: 16px;
    font-size: 12px;
    color: #64748b;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Document Portal Centered Clean Pagination */
.bridge-doc-pagination {
    margin: 48px auto 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}
.bridge-doc-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.bridge-doc-pagination .page-numbers:hover:not(.current):not(.dots) {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
}
.bridge-doc-pagination .page-numbers.current {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
    cursor: default;
}
.bridge-doc-pagination .page-numbers.dots {
    border: none;
    background: transparent;
    box-shadow: none;
    color: #94a3b8;
    padding: 0 4px;
    min-width: auto;
    cursor: default;
}
.bridge-doc-pagination .prev,
.bridge-doc-pagination .next {
    padding: 0 14px;
    font-weight: 500;
}

/* Mobile Sticky Action Bar (Hidden on Desktop) */
.bridge-doc-mobile-bar {
    display: none;
}

/* Responsive */
@media (max-width: 860px) {
    .bridge-doc-detail-wrapper {
        padding: 16px 14px 96px;
    }
    .bridge-doc-breadcrumbs {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px 0;
        margin-bottom: 16px;
        line-height: 1.5;
    }
    .bridge-doc-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }
    .bridge-doc-main-col {
        padding: 20px 16px;
    }
    .bridge-doc-action-card {
        padding: 20px 16px;
    }
    .sticky-sidebar {
        position: static;
    }
    .bridge-doc-meeting-card {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 10px 12px;
        padding: 12px 14px;
    }
    .bridge-doc-meeting-link {
        width: 100%;
        padding-top: 4px;
    }
    .bridge-doc-cards-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .bridge-doc-search-form {
        flex-direction: column;
    }
    .bridge-filter-group {
        flex-direction: column;
    }
    .group-label {
        padding-top: 0;
        margin-bottom: 6px;
    }
    .bridge-doc-pagination {
        margin: 32px auto 16px;
        gap: 6px;
    }
    .bridge-doc-pagination .page-numbers {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 13px;
    }
    .bridge-doc-mobile-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 990;
        background: #ffffff;
        border-top: 1px solid #e2e8f0;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
        box-sizing: border-box;
    }
    .bridge-doc-mobile-bar .mobile-bar-price {
        display: flex;
        flex-direction: column;
        min-width: 0;
        flex-shrink: 0;
    }
    .bridge-doc-mobile-bar .price-val {
        font-size: 20px;
        font-weight: 800;
        color: #e65100;
        line-height: 1.2;
    }
    .bridge-doc-mobile-bar .free-text {
        font-size: 17px;
        font-weight: 800;
        color: #2e7d32;
        line-height: 1.2;
    }
    .bridge-doc-mobile-bar .del-price {
        font-size: 11px;
        color: #94a3b8;
    }
    .bridge-doc-mobile-bar .mobile-bar-sub {
        font-size: 11px;
        color: #64748b;
        margin-top: 2px;
    }
    .bridge-doc-mobile-bar .mobile-bar-action {
        flex: 1;
        min-width: 0;
        display: flex;
        justify-content: flex-end;
    }
    .bridge-doc-mobile-bar .mobile-bar-btn {
        width: 100%;
        max-width: 240px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 11px 14px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 700;
        color: #ffffff;
        text-decoration: none;
        border: none;
        cursor: pointer;
        box-sizing: border-box;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .bridge-doc-mobile-bar .mobile-bar-btn-download {
        background: #2e7d32;
    }
    .bridge-doc-mobile-bar .mobile-bar-btn-buy {
        background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    }
}

@media (max-width: 540px) {
    .bridge-doc-title {
        font-size: 20px;
    }
    .bridge-doc-meta-row {
        gap: 8px 14px;
        font-size: 12px;
    }
    .bridge-doc-related-item {
        padding: 10px 12px;
        gap: 8px;
    }
}
