/* Video Summary Page Styles */
.d-none {
    display: none !important;
}

@media (min-width: 768px) {
    .d-md-block {
        display: block !important;
    }

    .d-md-none {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .d-md-block {
        display: none !important;
    }

    .d-md-none {
        display: block !important;
    }
}

.video-summary-content {
    padding: var(--spacing-xl) 0;
}

/* Improved section spacing and visual hierarchy */
section {
    margin-bottom: var(--spacing-xl);
}

section:last-child {
    margin-bottom: 0;
}

/* Better card spacing */
.card {
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.card-body {
    padding: var(--spacing-lg);
}

/* Improved section headers */
section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

section h2 i {
    font-size: 1.25rem;
}

/* FAQ Section Styling */
.faq-item-simple {
    margin-bottom: var(--spacing-lg);
}

.faq-item-simple:last-child {
    margin-bottom: 0;
}

.faq-question {
    font-weight: 600;
    color: var(--primary-800);
    font-size: 1rem;
    margin-bottom: var(--spacing-sm);
}

.faq-answer {
    color: var(--gray-900);
    line-height: 1.6;
    font-size: 1rem;
}

/* Share Section Styling */
.share-container {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.share-header {
    margin-bottom: var(--spacing-xl);
}

.share-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.share-title i {
    color: var(--primary-600);
    font-size: 1.5rem;
}

.share-subtitle {
    color: var(--gray-600);
    font-size: 1rem;
    margin: 0;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-width: 140px;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.share-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.share-btn:hover::before {
    left: 100%;
}

.share-btn-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.share-btn-text {
    font-weight: 600;
}

/* Copy Link Button */
.share-btn-copy {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.share-btn-copy:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    color: white;
}

/* Twitter Button */
.share-btn-twitter {
    background: linear-gradient(135deg, #1da1f2 0%, #0d8bd9 100%);
    color: white;
}

.share-btn-twitter:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(29, 161, 242, 0.3);
    color: white;
}

/* LinkedIn Button */
.share-btn-linkedin {
    background: linear-gradient(135deg, #0077b5 0%, #005885 100%);
    color: white;
}

.share-btn-linkedin:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 119, 181, 0.3);
    color: white;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .share-buttons {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-md);
    }

    .share-btn {
        width: 100%;
        max-width: 280px;
    }

    .share-title {
        font-size: 1.5rem;
    }
}

/* Related Videos Section */
.related-videos-loading {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--gray-600);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--primary-600);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-md);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.related-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: var(--spacing-lg);
}

@media (min-width: 992px) {
    .related-videos-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.video-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--gray-300);
}

.video-card .thumb {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
    background: #000;
}

.video-card .thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-card:hover .thumb img {
    transform: scale(1.05);
}

.category-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(15, 23, 42, 0.9);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.duration-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.video-card .info {
    padding: 1rem;
}

.video-card .title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-card .meta {
    font-size: 0.9rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.video-card .meta i {
    color: var(--gray-400);
}

.video-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: var(--spacing-xl) 0;
    margin-bottom: var(--spacing-xl);
}

.video-header .container {
    display: flex;
    gap: var(--spacing-lg);
    align-items: flex-start;
}

/* Video Thumbnail with Play Overlay */
.video-thumbnail-wrapper {
    position: relative;
    align-self: center;
    width: 250px;
    height: 150px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.video-thumbnail-wrapper:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.video-thumbnail-wrapper:hover .video-thumbnail-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.video-play-btn {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.video-thumbnail-wrapper:hover .video-play-btn {
    transform: scale(1.1);
    background: white;
}

.video-play-btn i {
    font-size: 1.75rem;
    color: #667eea;
    margin-left: 4px;
    /* Optical centering */
}

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

.video-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0 0 var(--spacing-sm) 0;
    line-height: 1.2;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.video-meta {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: var(--spacing-sm);
    opacity: 0.9;
}

.video-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.video-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    width: 100%;
}

.summary-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.summary-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.summary-card .card-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.summary-card .card-body {
    padding: var(--spacing-lg);
}

.summary-text {
    line-height: 1.6;
    color: var(--gray-700);
    font-size: 1rem;
}

.topics-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.topic-tag {
    background: var(--primary-50);
    color: var(--primary-700);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--primary-200);
}

/* Topics toggle button */
.topics-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    margin-top: var(--spacing-sm);
    border-radius: var(--radius-full);
    background: var(--primary-50);
    color: var(--primary-700);
    border: 1px solid var(--primary-200);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.topics-toggle-btn:hover {
    background: var(--primary-100);
    border-color: var(--primary-300);
}

.topics-toggle-btn i {
    transition: transform 0.2s ease;
}

.topics-toggle-btn[aria-expanded="true"] {
    background: var(--primary-600);
    color: white;
    border-color: var(--primary-600);
}

.topics-toggle-btn[aria-expanded="true"] i {
    transform: rotate(180deg);
}

@media (max-width: 768px) {
    .topics-toggle-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Small variant for chapter topics */
.topics-toggle-btn--sm {
    padding: 6px 10px;
    font-size: 0.85rem;
}

.index-section {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--spacing-xl);
}

.index-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.index-content {
    padding: var(--spacing-lg);
}

.module {
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.module-header {
    background: var(--primary-50);
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--primary-200);
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    transition: background-color 0.2s;
}

.module-header:hover {
    background: var(--primary-100);
}

.module-title {
    font-weight: 600;
    color: var(--primary-800);
    flex: 1;
    line-height: 1.4;
}

.module-time {
    color: var(--primary-600);
    font-size: 0.9rem;
    font-weight: 500;
}

.module-time a {
    color: var(--primary-600);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.module-time a:hover {
    background: var(--primary-100);
    color: var(--primary-700);
}

.module-content {
    padding: var(--spacing-lg);
    background: white;
}

.module-summary {
    color: var(--gray-600);
    margin-bottom: var(--spacing-md);
    line-height: 1.5;
}

.chapters-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* Chapter with Thumbnail Layout */
.chapter {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}

/* Chapter Thumbnail */
.chapter-thumbnail {
    position: relative;
    width: 180px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chapter-thumbnail:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.chapter-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.chapter-thumbnail:hover .thumbnail-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.thumbnail-overlay i {
    font-size: 2.5rem;
    color: white;
    opacity: 0.9;
    transition: all 0.2s ease;
}

.chapter-thumbnail:hover .thumbnail-overlay i {
    transform: scale(1.1);
    opacity: 1;
}

.thumbnail-timestamp {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Chapter Content */
.chapter-content {
    flex: 1;
    min-width: 0;
}

.chapter-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.chapter-title {
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.4;
}

.chapter-duration {
    font-size: 0.85rem;
    color: var(--gray-500);
    white-space: nowrap;
    font-weight: 500;
}

.chapter-summary {
    font-size: 0.9rem;
    color: var(--gray-700);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.chapter-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.chapter-topic {
    background: var(--gray-200);
    color: var(--gray-700);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

.collapsible {
    display: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.collapsible.open {
    display: block;
    max-height: 9999px;
    overflow: visible;
    transition: max-height 0.3s ease-in;
}

.module-preview {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--primary-25);
    color: var(--primary-700);
    font-size: 0.9rem;
    line-height: 1.4;
    border-top: 1px solid var(--primary-200);
}

.chevron {
    transition: transform 0.2s;
    margin-top: 2px;
    flex-shrink: 0;
}

.chevron.open {
    transform: rotate(90deg);
}

.avatar-link {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-weight: 600;
    padding: 4px 8px;
    backdrop-filter: blur(10px);
}

.avatar-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.25);
    text-decoration: none;
    backdrop-filter: blur(10px);
    border-radius: var(--radius-sm);
}

.avatar-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .video-header {
        padding: var(--spacing-lg) 0;
        margin-bottom: var(--spacing-lg);
    }

    .video-header .container {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-md);
    }

    .video-thumbnail-wrapper {
        width: 100%;
        max-width: 280px;
        height: auto;
        aspect-ratio: 16/9;
    }

    .video-thumbnail {
        width: 100%;
        height: 100%;
    }

    .video-play-btn {
        width: 56px;
        height: 56px;
    }

    .video-play-btn i {
        font-size: 1.5rem;
    }

    .video-title {
        font-size: 1.4rem;
        margin-bottom: var(--spacing-sm);
    }

    .video-meta {
        justify-content: center;
        gap: var(--spacing-sm);
        margin-bottom: var(--spacing-sm);
    }

    /* Ensure parent aligns center so Added by centers reliably */
    .video-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .video-actions {
        justify-content: center;
        flex-direction: column;
        gap: var(--spacing-sm);
        padding: 0 var(--spacing-sm);
    }

    .btn-white {
        flex: none;
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
        font-size: 0.85rem;
        padding: 12px 16px;
    }

    .summary-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        margin-bottom: var(--spacing-lg);
    }

    .summary-card .card-header,
    .summary-card .card-body,
    .index-header,
    .index-content {
        padding: var(--spacing-sm);
    }

    .module-content {
        padding: var(--spacing-sm);
    }

    .chapter {
        flex-direction: column;
        gap: 0.75rem;
    }

    /* Reorder: Title & description first, then thumbnail */
    .chapter-content {
        order: 1;
    }

    .chapter-thumbnail {
        order: 2;
        width: 100%;
        max-width: 100%;
    }

    .chapter-header {
        flex-direction: column;
        gap: 0.25rem;
    }

    .video-summary-content {
        padding: var(--spacing-sm) 0;
    }
}

/* Tablet responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .chapter-thumbnail {
        width: 140px;
    }

    .thumbnail-overlay i {
        font-size: 2rem;
    }
}

/* ============================================
   People Also Asked (PAA) Accordion
   ============================================ */

.paa-section {
    margin-bottom: var(--spacing-xl);
}

.paa-content {
    padding: 0 !important;
}

.paa-item {
    border-bottom: 1px solid var(--gray-200);
}

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

.paa-divider {
    display: none; /* Use border-bottom on .paa-item instead */
}

.paa-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    line-height: 1.5;
    transition: background-color 0.15s ease, color 0.15s ease;
    gap: var(--spacing-md);
}

.paa-question:hover {
    background-color: var(--gray-50);
    color: var(--primary-700);
}

.paa-question:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: -2px;
}

.paa-question-text {
    flex: 1;
    min-width: 0;
}

.paa-chevron {
    flex-shrink: 0;
    font-size: 0.85rem;
    color: var(--gray-400);
    transition: transform 0.25s ease, color 0.15s ease;
}

.paa-chevron--open {
    transform: rotate(180deg);
    color: var(--primary-600);
}

/* Answer panel */
.paa-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    padding: 0 var(--spacing-lg);
    background: var(--gray-50);
}

.paa-answer--open {
    max-height: 2000px;
    padding: var(--spacing-md) var(--spacing-lg) var(--spacing-lg);
    transition: max-height 0.4s ease-in, padding 0.3s ease-in;
}

.paa-answer-text {
    color: var(--gray-700);
    line-height: 1.7;
    font-size: 0.95rem;
    margin-bottom: var(--spacing-md);
    white-space: pre-line;
}

.paa-cta {
    margin-top: var(--spacing-sm);
}

.paa-chat-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: var(--primary-50);
    color: var(--primary-700);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--primary-200);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.paa-chat-link:hover {
    background: var(--primary-100);
    border-color: var(--primary-300);
    text-decoration: none;
    color: var(--primary-800);
}

.paa-chat-link i {
    font-size: 0.8rem;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .paa-question {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.95rem;
    }

    .paa-answer--open {
        padding: var(--spacing-sm) var(--spacing-md) var(--spacing-md);
    }

    .paa-chat-link {
        width: 100%;
        justify-content: center;
        padding: 10px 14px;
    }
}