@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --trcodex-primary: #E31E24;
    --trcodex-dark: #121212;
    --trcodex-bg: #ffffff;
    --trcodex-gray-100: #f8f9fa;
    --trcodex-gray-200: #e9ecef;
    --trcodex-text-main: #2d3436;
    --trcodex-text-light: #636e72;
    --trcodex-transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

* {
    box-sizing: border-box;
}

.trcodex-news-container {
    display: flex;
    gap: 24px;
    font-family: 'Outfit', sans-serif;
    height: 540px;
    margin-bottom: 40px;
    position: relative;
    color: var(--trcodex-text-main);
}

.trcodex-news-container.position-right {
    flex-direction: row-reverse;
}

/* Slider Section */
.trcodex-news-slider-wrapper {
    flex: 1.2;
    min-width: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.trcodex-news-main-slider {
    width: 100%;
    height: 100%;
}

.trcodex-slider-item {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
    overflow: hidden;
}

.trcodex-slider-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/* Mobile: fit images better - show full image */
@media (max-width: 768px) {
    .trcodex-slider-image {
        background-size: contain !important;
        background-position: center !important;
        background-color: #000 !important;
    }
}

.trcodex-slider-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.95) 100%);
    pointer-events: none;
}

.trcodex-slider-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 40px 40px;
    color: #fff;
    z-index: 2;
}

.trcodex-news-badge {
    display: inline-block;
    padding: 6px 14px;
    background-color: var(--trcodex-primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.trcodex-slider-title {
    font-size: 2.4rem;
    font-weight: 800;
    margin: 0 0 15px 0;
    line-height: 1.1;
    color: #ffffff;
    text-wrap: balance;
}

.trcodex-slider-meta {
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0.9;
}

/* List Section */
.trcodex-news-list-wrapper {
    flex: 0.8;
    display: flex;
    flex-direction: column;
    background: var(--trcodex-gray-100);
    border: 1px solid var(--trcodex-gray-200);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.trcodex-news-list-header {
    padding: 24px;
    background: #fff;
    border-bottom: 1px solid var(--trcodex-gray-200);
}

.trcodex-news-list-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--trcodex-text-main);
}

.trcodex-news-list-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--trcodex-primary) transparent;
}

.trcodex-news-list-items::-webkit-scrollbar {
    width: 4px;
}

.trcodex-news-list-items::-webkit-scrollbar-thumb {
    background: var(--trcodex-primary);
    border-radius: 10px;
}

.trcodex-news-list-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    margin-bottom: 12px;
    background: #fff;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--trcodex-transition);
    border: 1px solid transparent;
    border-left: 5px solid transparent;
    /* Prevent layout shift */
}

.trcodex-news-list-item:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
    border-left-color: rgba(227, 30, 36, 0.2);
}

.trcodex-news-list-item.active {
    background: rgba(227, 30, 36, 0.04);
    border-color: var(--trcodex-primary);
    border-left: 5px solid var(--trcodex-primary);
    box-shadow: 0 12px 25px rgba(227, 30, 36, 0.08);
}

.trcodex-item-thumb {
    width: 100px;
    height: 100px;
    min-width: 100px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
}

.trcodex-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.trcodex-item-title {
    margin: 0 0 8px 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--trcodex-text-main);
    line-height: 1.3;
}

.trcodex-item-excerpt {
    font-size: 0.8rem;
    color: var(--trcodex-text-light);
    margin: 0 0 10px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trcodex-item-date {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--trcodex-text-light);
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Category Tabs */
.trcodex-category-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 0 5px 5px 0;
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
}

.trcodex-category-tabs::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Chrome/Safari */
}

.trcodex-cat-tab {
    white-space: nowrap;
    padding: 8px 16px;
    background: var(--trcodex-gray-200);
    border: none;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--trcodex-text-light);
    cursor: pointer;
    transition: var(--trcodex-transition);
}

.trcodex-cat-tab:hover {
    background: #e0e0e0;
    color: var(--trcodex-text-main);
}

.trcodex-cat-tab.active {
    background: var(--trcodex-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(227, 30, 36, 0.2);
}

/* Swiper Controls */
.swiper-button-next,
.swiper-button-prev {
    display: none !important;
    /* Hide as per request */
}

.swiper-pagination {
    bottom: 25px !important;
}

.swiper-pagination-bullet {
    background: #fff;
    opacity: 0.4;
    width: 8px;
    height: 8px;
    margin: 0 4px !important;
    transition: var(--trcodex-transition);
}

.swiper-pagination-bullet-active {
    background: var(--trcodex-primary);
    opacity: 1;
    width: 28px;
    border-radius: 5px;
}

/* ============================================
   MOBILE RESPONSIVE DESIGN - COMPLETE REDESIGN
   ============================================ */

@media (max-width: 1024px) {
    .trcodex-news-container {
        flex-direction: column !important;
        height: auto !important;
        gap: 30px !important;
        margin-bottom: 40px !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }

    .trcodex-news-slider-wrapper {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 9;
        min-height: 320px;
        max-height: 420px;
        flex: none !important;
        border-radius: 16px !important;
        overflow: hidden;
    }

    .trcodex-news-list-wrapper {
        width: 100% !important;
        height: auto !important;
        flex: none !important;
    }

    .trcodex-news-list-items {
        height: auto !important;
        overflow: visible !important;
    }

    .trcodex-slider-content {
        padding: 40px 30px 30px !important;
    }

    .trcodex-slider-title {
        font-size: 1.8rem !important;
        line-height: 1.2 !important;
    }
}

/* TABLET & MOBILE - 768px BREAKPOINT */
@media (max-width: 768px) {
    .trcodex-news-container {
        gap: 24px !important;
        margin-bottom: 30px !important;
        margin-left: -20px !important;
        margin-right: -20px !important;
        width: calc(100% + 40px) !important;
        max-width: calc(100% + 40px) !important;
    }

    .trcodex-news-slider-wrapper {
        aspect-ratio: 5 / 3 !important;
        min-height: 340px !important;
        max-height: 380px !important;
        height: 340px !important;
        border-radius: 12px !important;
        margin: 0 20px !important;
    }

    /* FORCE swiper height */
    .trcodex-news-slider-wrapper .swiper,
    .trcodex-news-slider-wrapper .swiper-wrapper,
    .trcodex-news-slider-wrapper .swiper-slide {
        height: 100% !important;
        min-height: 100% !important;
    }

    .trcodex-slider-content {
        padding: 28px 18px 22px !important;
    }

    .trcodex-news-badge {
        font-size: 0.65rem !important;
        padding: 5px 12px !important;
        margin-bottom: 10px !important;
        letter-spacing: 0.8px !important;
    }

    .trcodex-slider-title {
        font-size: 1.45rem !important;
        line-height: 1.25 !important;
        margin-bottom: 10px !important;
    }

    .trcodex-slider-meta {
        font-size: 0.75rem !important;
    }

    /* List Styling - BIGGER CARDS */
    .trcodex-news-list-wrapper {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 20px !important;
        margin: 0 !important;
        width: 100% !important;
    }

    .trcodex-news-list-header {
        padding: 0 0 18px 0 !important;
        background: transparent !important;
        border-bottom: 2px solid var(--trcodex-gray-200) !important;
        margin-bottom: 18px !important;
    }

    .trcodex-news-list-header h3 {
        font-size: 1.2rem !important;
        margin-bottom: 12px !important;
        font-weight: 800 !important;
    }

    .trcodex-category-tabs {
        gap: 8px !important;
        flex-wrap: wrap;
        padding-bottom: 0 !important;
    }

    .trcodex-cat-tab {
        padding: 9px 18px !important;
        font-size: 0.78rem !important;
        border-radius: 20px !important;
        font-weight: 600 !important;
    }

    .trcodex-news-list-items {
        padding: 0 !important;
        gap: 16px;
        display: flex;
        flex-direction: column;
        margin: 0 !important;
    }

    /* LARGE NEWS CARDS - Like the example */
    .trcodex-news-list-item {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        padding: 0 !important;
        margin-bottom: 0 !important;
        background: #fff !important;
        border: 1px solid var(--trcodex-gray-200) !important;
        border-left: none !important;
        border-radius: 14px !important;
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06) !important;
        transition: all 0.3s ease !important;
        overflow: hidden !important;
    }

    .trcodex-news-list-item:hover {
        transform: translateY(-3px) !important;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1) !important;
    }

    .trcodex-news-list-item.active {
        border: 2px solid var(--trcodex-primary) !important;
        box-shadow: 0 6px 24px rgba(227, 30, 36, 0.15) !important;
    }

    /* BIG THUMBNAIL - Full width at top */
    .trcodex-item-thumb {
        width: 100% !important;
        height: 200px !important;
        min-width: 100% !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background-size: contain !important;
        background-position: center !important;
        background-color: #f8f9fa !important;
        background-repeat: no-repeat !important;
    }

    .trcodex-item-details {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 18px 18px 20px 18px !important;
        gap: 10px !important;
    }

    .trcodex-item-title {
        font-size: 1.15rem !important;
        font-weight: 700 !important;
        line-height: 1.35 !important;
        margin: 0 !important;
        color: var(--trcodex-text-main) !important;
        display: -webkit-box;
        -webkit-line-clamp: 2 !important;
        line-clamp: 2 !important;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .trcodex-item-excerpt {
        font-size: 0.88rem !important;
        line-height: 1.6 !important;
        margin: 0 !important;
        color: var(--trcodex-text-light) !important;
        display: -webkit-box;
        -webkit-line-clamp: 3 !important;
        line-clamp: 3 !important;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .trcodex-item-date {
        font-size: 0.75rem !important;
        color: var(--trcodex-text-light) !important;
        font-weight: 600 !important;
        margin-top: 4px !important;
    }
}

/* MOBILE PHONE - 480px BREAKPOINT */
@media (max-width: 480px) {
    .trcodex-news-container {
        gap: 20px !important;
    }

    .trcodex-news-slider-wrapper {
        aspect-ratio: 5 / 3 !important;
        min-height: 280px !important;
        max-height: 320px !important;
        height: 280px !important;
        border-radius: 12px !important;
    }

    /* FORCE swiper height */
    .trcodex-news-slider-wrapper .swiper,
    .trcodex-news-slider-wrapper .swiper-wrapper,
    .trcodex-news-slider-wrapper .swiper-slide {
        height: 100% !important;
        min-height: 100% !important;
    }

    .trcodex-slider-content {
        padding: 22px 16px 18px !important;
    }

    .trcodex-news-badge {
        font-size: 0.6rem !important;
        padding: 4px 10px !important;
    }

    .trcodex-slider-title {
        font-size: 1.2rem !important;
        line-height: 1.3 !important;
    }

    .trcodex-slider-meta {
        font-size: 0.72rem !important;
    }

    .trcodex-news-list-header h3 {
        font-size: 1.1rem !important;
    }

    .trcodex-cat-tab {
        padding: 8px 16px !important;
        font-size: 0.72rem !important;
    }

    .trcodex-news-list-items {
        gap: 14px;
    }

    .trcodex-news-list-item {
        border-radius: 12px !important;
    }

    .trcodex-item-thumb {
        height: 180px !important;
        background-size: contain !important;
        background-position: center !important;
        background-color: #f8f9fa !important;
        background-repeat: no-repeat !important;
    }

    .trcodex-item-details {
        padding: 16px !important;
        gap: 8px !important;
    }

    .trcodex-item-title {
        font-size: 1.05rem !important;
        line-height: 1.35 !important;
    }

    .trcodex-item-excerpt {
        font-size: 0.85rem !important;
        -webkit-line-clamp: 2 !important;
        line-clamp: 2 !important;
    }

    .trcodex-item-date {
        font-size: 0.7rem !important;
    }
}