/* Dedicated Premium styles for Front News section */

:root {
    --primary-orange: #E94C1F;
    --primary-orange-hover: #d23a10;
    --dark-text: #111827;
    --muted-text: #6B7280;
    --border-color: #E5E7EB;
    --border-color-soft: rgba(229, 231, 235, 0.6);
    --like-color: #E94C1F;
    --dislike-color: #EF4444;
}

/* Page base settings */
.page-news,
.page-news-detail {
    padding-top: 70px !important;
    padding-bottom: 60px !important;
    margin-top: 0 !important;
    background-color: #FAFAFB;
}

@media (max-width: 1199px) {

    .page-news,
    .page-news-detail {
        padding-top: 60px !important;
        padding-bottom: 50px !important;
    }
}

@media (max-width: 767px) {

    .page-news,
    .page-news-detail {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }
}

/* Post Card */
.news-card {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid var(--border-color-soft);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.news-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    border: 2px solid transparent;
    transition: border-color 0.35s ease;
    pointer-events: none;
}

.news-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -15px rgba(17, 24, 39, 0.08), 0 4px 12px -2px rgba(17, 24, 39, 0.03);
}

.news-card:hover::after {
    border-color: rgba(233, 76, 31, 0.12);
}

/* Image / Media Container (16:9 Aspect Ratio) */
.news-media-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    background-color: #0f172a;
    overflow: hidden;
}

.news-media-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.news-card:hover .news-media-content {
    transform: scale(1.05);
}

/* Video controls preview overlay */
.video-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.news-card:hover .video-preview-overlay {
    background: rgba(15, 23, 42, 0.4);
}

.video-play-btn {
    width: 54px;
    height: 54px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s;
}

.video-preview-overlay:hover .video-play-btn {
    transform: scale(1.12);
    background: var(--primary-orange);
}

.video-preview-overlay:hover .video-play-btn svg {
    fill: #ffffff;
}

.video-play-btn svg {
    margin-left: 4px;
    /* offset play icon slightly to center it visually */
    fill: var(--primary-orange);
    width: 22px;
    height: 22px;
    transition: fill 0.2s;
}

/* Card Body */
.news-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Placeholder styling for cards without media */
.placeholder-gradient {
    background: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%);
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.placeholder-logo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-logo {
    width: 120px;
    height: auto;
    opacity: 0.12;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.news-card:hover .placeholder-logo {
    opacity: 0.18;
    transform: scale(1.05);
}

/* Source & Meta */
.news-meta-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.news-source-badge {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary-orange);
    transition: color 0.2s ease;
}

.news-source-badge:hover {
    color: var(--primary-orange-hover);
}

.news-source-name {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.news-source-logo {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 6px;
    border: 1px solid rgba(233, 76, 31, 0.15);
}

.news-meta-divider {
    font-size: 11px;
    color: #D1D5DB;
}

.news-date {
    font-size: 12px;
    color: var(--muted-text);
    font-weight: 500;
}

/* Title & Description */
.news-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark-text);
    margin: 4px 0 10px 0;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.news-card-title a {
    color: var(--dark-text);
    text-decoration: none;
}

.news-card-title a:hover {
    color: var(--primary-orange);
}

.news-card-desc {
    font-size: 14px;
    color: #4B5563;
    line-height: 1.6;
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.news-read-more-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary-orange);
    font-weight: 600;
    font-size: 13.5px;
    text-decoration: none;
    margin-bottom: 12px;
    transition: gap 0.2s ease, color 0.2s ease;
    gap: 4px;
}

.news-read-more-link:hover {
    color: var(--primary-orange-hover);
    gap: 8px;
}

/* Divider line */
.news-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 16px 0 16px 0;
    border: none;
    opacity: 0.6;
}

/* Actions Row (Like, Dislike, Share) */
.news-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-reactions-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-action-btn {
    background: transparent;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #6B7280;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.news-action-btn:hover {
    background-color: #F3F4F6;
    color: #111827;
    transform: translateY(-1px);
}

/* Active Liked State */
.news-action-btn.like-btn.active {
    background: rgba(233, 76, 31, 0.06);
    color: var(--like-color);
}

.news-action-btn.like-btn.active svg {
    fill: var(--like-color);
    stroke: var(--like-color);
}

/* Active Disliked State */
.news-action-btn.dislike-btn.active {
    background: rgba(239, 68, 68, 0.06);
    color: var(--dislike-color);
}

.news-action-btn.dislike-btn.active svg {
    fill: var(--dislike-color);
    stroke: var(--dislike-color);
}

/* Share button */
.news-share-btn {
    background: transparent;
    border: none;
    padding: 7px 10px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.news-share-btn:hover {
    background: #F3F4F6;
    transform: translateY(-1px);
}

.news-share-btn svg {
    stroke: #6B7280;
}

.news-share-btn:hover svg {
    stroke: #111827;
}

/* Detail View Custom styles */
.news-detail-wrapper {
    background: #ffffff;
    border-radius: 24px;
    border: 1px solid rgba(229, 231, 235, 0.7);
    padding: 40px;
    box-shadow: 0 20px 50px -12px rgba(17, 24, 39, 0.04), 0 1px 3px rgba(17, 24, 39, 0.01);
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .news-detail-wrapper {
        padding: 24px 16px;
        border-radius: 16px;
    }
}

.news-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #4B5563;
    font-weight: 600;
    font-size: 14.5px;
    text-decoration: none;
    margin-bottom: 28px;
    transition: all 0.2s ease;
}

.news-back-link svg {
    transition: transform 0.2s ease;
}

.news-back-link:hover {
    color: var(--primary-orange);
}

.news-back-link:hover svg {
    transform: translateX(-4px);
}

.news-detail-header-block {
    margin-bottom: 30px;
}

.news-detail-title {
    font-size: 30px;
    font-weight: 800;
    color: #111827;
    margin-top: 20px;
    margin-bottom: 20px;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

@media (max-width: 768px) {
    .news-detail-title {
        font-size: 19px;
    }
}

.news-detail-media-wrap {
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 35px;
    border: 1px solid rgba(229, 231, 235, 0.8);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
}

.news-detail-body {
    font-size: 16.5px;
    color: #374151;
    line-height: 1.85;
    margin-bottom: 40px;
}

.news-detail-body img {
    border-radius: 16px;
    max-width: 100%;
    max-height: 520px;
    height: auto;
    display: block;
    margin: 28px auto;
    object-fit: contain;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
}

.news-detail-body p {
    margin-bottom: 20px;
}

/* Enhancements for blockquotes, headers and lists inside editor body */
.news-detail-body h2 {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin-top: 36px;
    margin-bottom: 16px;
}

.news-detail-body h3 {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin-top: 28px;
    margin-bottom: 12px;
}

.news-detail-body blockquote {
    border-left: 4px solid var(--primary-orange) !important;
    padding: 16px 24px !important;
    color: #374151 !important;
    font-style: italic !important;
    background-color: rgba(233, 76, 31, 0.03) !important;
    margin: 24px 0 !important;
    border-radius: 0 12px 12px 0;
    font-size: 17px;
    border-top: none !important;
    border-bottom: none !important;
    border-right: none !important;
}

.news-detail-body ul,
.news-detail-body ol {
    margin-bottom: 20px;
    padding-left: 28px;
}

.news-detail-body li {
    margin-bottom: 8px;
}

/* App Install CTA banner styling */
.app-promo-banner {
    background: linear-gradient(135deg, rgba(233, 76, 31, 0.08) 0%, rgba(233, 76, 31, 0.03) 100%);
    border-radius: 16px;
    border: 1px solid rgba(233, 76, 31, 0.15);
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.app-promo-banner:hover {
    border-color: rgba(233, 76, 31, 0.25);
    box-shadow: 0 8px 24px -8px rgba(233, 76, 31, 0.1);
}

.app-promo-title {
    font-weight: 700;
    font-size: 14px;
    color: #1F2937;
}

.app-promo-btn {
    background: var(--primary-orange);
    color: #ffffff !important;
    border-radius: 30px;
    font-size: 12.5px;
    font-weight: 700;
    padding: 8px 18px;
    box-shadow: 0 4px 10px rgba(233, 76, 31, 0.25);
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.app-promo-btn:hover {
    background: var(--primary-orange-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(233, 76, 31, 0.35);
    color: #ffffff !important;
}

/* Feedback card styling */
.news-detail-feedback-card {
    background-color: #F9FAFB;
    border-radius: 20px;
    border: 1px solid #E5E7EB;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    margin-bottom: 20px;
    gap: 16px;
}

@media (max-width: 576px) {
    .news-detail-feedback-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }
}

.news-feedback-title {
    font-size: 16.5px;
    font-weight: 700;
    color: var(--dark-text);
    margin: 0;
}

/* Image Slider styles (Bootstrap carousel adjustment) */
.news-carousel .carousel-inner {
    border-radius: 20px;
}

.news-carousel .carousel-item {
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    background: #000;
    position: relative;
}

.news-carousel .carousel-item img,
.news-carousel .carousel-item iframe,
.news-carousel .carousel-item video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
}

.carousel-indicators [data-bs-target] {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.6);
}

.carousel-indicators .active {
    background-color: var(--primary-orange);
    width: 16px;
    border-radius: 4px;
}

/* Clipboard Toast notification */
.toast-copied {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #111827;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.toast-copied.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Quill formatting elements rendering */
.news-detail-body .ql-align-center {
    text-align: center;
}

.news-detail-body .ql-align-right {
    text-align: right;
}

.news-detail-body .ql-align-justify {
    text-align: justify;
}

.news-detail-body .ql-align-left {
    text-align: left;
}

.news-detail-body .ql-indent-1 {
    padding-left: 2em;
}

.news-detail-body .ql-indent-2 {
    padding-left: 4em;
}

.news-detail-body .ql-indent-3 {
    padding-left: 6em;
}

.news-detail-body .ql-indent-4 {
    padding-left: 8em;
}

.news-detail-body .ql-indent-5 {
    padding-left: 10em;
}

.news-detail-body .ql-indent-6 {
    padding-left: 12em;
}

.news-detail-body .ql-indent-7 {
    padding-left: 14em;
}

.news-detail-body .ql-indent-8 {
    padding-left: 16em;
}

.news-detail-body p {
    white-space: pre-wrap;
    margin-bottom: 12px;
}

/* Lightbox modal styling */
.news-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
}

.news-lightbox.show {
    opacity: 1;
    pointer-events: auto;
}

.news-lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.news-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.08);
}

.news-lightbox-close svg {
    stroke: #ffffff;
}

.news-lightbox-content {
    max-width: 90%;
    max-height: 85%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.95);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.news-lightbox.show .news-lightbox-content {
    transform: scale(1);
}

.news-lightbox-content img {
    max-width: 90vw !important;
    max-height: 85vh !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Compact horizontal list layout for mobile screens */
@media (max-width: 767px) {
    .news-card {
        flex-direction: row !important;
        align-items: stretch !important;
        min-height: 120px;
        border-radius: 16px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    }

    .news-media-container {
        width: 110px !important;
        height: auto !important;
        padding-top: 0 !important;
        /* Reset 16:9 vertical padding */
        flex-shrink: 0 !important;
        background-color: #f1f5f9;
        border-radius: 16px 0 0 16px !important;
        overflow: hidden;
    }

    .news-media-content {
        position: relative !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    .placeholder-logo {
        width: 60px !important;
    }

    .news-card-body {
        padding: 12px 14px !important;
        justify-content: space-between !important;
        display: flex !important;
        flex-direction: column !important;
        flex-grow: 1 !important;
    }

    .news-meta-row {
        gap: 6px !important;
        margin-bottom: 4px !important;
    }

    .news-source-name {
        font-size: 8px !important;
    }

    .news-meta-divider {
        font-size: 10px !important;
    }

    .news-date {
        font-size: 11px !important;
    }

    .news-card-title {
        font-size: 12px !important;
        margin: 2px 0 6px 0 !important;
        line-height: 1.35 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 3 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }

    .news-card-desc,
    .news-read-more-link,
    .news-divider {
        display: none !important;
        /* Hide description, divider and read more to make it super compact */
    }

    .news-actions-row {
        margin-top: auto !important;
    }

    .news-action-btn {
        padding: 4px 8px !important;
        font-size: 11px !important;
        border-radius: 6px !important;
    }

    .news-action-btn svg {
        width: 14px !important;
        height: 14px !important;
    }

    .news-share-btn {
        padding: 4px 8px !important;
        border-radius: 6px !important;
    }

    .news-share-btn svg {
        width: 14px !important;
        height: 14px !important;
    }

    /* Adjust carousel inside mobile card thumbnail */
    .news-carousel .carousel-indicators,
    .news-carousel .carousel-control-prev,
    .news-carousel .carousel-control-next {
        display: none !important;
    }

    .news-carousel,
    .news-carousel .carousel-inner,
    .news-carousel .carousel-item {
        height: 100% !important;
        padding-top: 0 !important;
        position: relative !important;
    }

    .news-carousel .carousel-item img {
        position: relative !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    /* Mobile Breadcrumb adjustment */
    .breadcrumb {
        line-height: 1.5 !important;
        row-gap: 6px !important;
    }

    .breadcrumb-item,
    .breadcrumb-item a {
        font-size: 13px !important;
    }

    /* Stack app banner elements vertically on phones only */
    .app-promo-banner {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 12px !important;
    }

    .app-promo-btn {
        width: 100% !important;
        text-align: center !important;
    }
}