/* ==========================================================================
   Common Layout Styles
   ========================================================================== */

/* Twitter-like Layout Styles for Homepage */

.content-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Global Posts Grid & Post Cards */
.postsGrid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.postCard {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: none;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.postCardThumb {
    position: relative;
    width: 320px;
    flex-shrink: 0;
    overflow: hidden;
    background-color: var(--bg-secondary);
}

.postCardThumb a {
    display: block;
    width: 100%;
    height: 100%;
}

.postCardThumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
    margin: 0;
}

.postCard:hover .postCardThumb img {
    transform: scale(1.03);
}

.postCardBody {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.postCardCat {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 15px;
    flex-wrap: wrap;
    line-height: 1.4;
}

.postCardCatSep {
    color: var(--text-secondary);
    opacity: 0.6;
    font-weight: 400;
}

.postCardDateText {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    text-decoration: none !important;
    vertical-align: middle;
    margin-left: 6px;
    letter-spacing: 0.01em;
}

.postCardDateText.postCardBadgeActive {
    background: var(--bg-red);
    color: var(--color-red);
}

.postCardDateText.postCardBadgeUrgent {
    background: var(--bg-orange);
    color: var(--color-orange);
}

.postCardDateText.postCardBadgeExpired {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

:root.dark-theme .postCardDateText.postCardBadgeActive {
    color: #f87171;
    background: rgba(248, 113, 113, 0.12);
}

:root.dark-theme .postCardDateText.postCardBadgeUrgent {
    color: #fb923c;
    background: rgba(251, 146, 60, 0.12);
}

:root.dark-theme .postCardDateText.postCardBadgeExpired {
    color: var(--text-muted);
    background: var(--bg-secondary);
}

.postCardCat .postCardDateText {
    margin-left: 0;
}

.postCardCat .label {
    display: flex;
    align-items: center;
}

.postCardCat .label::before {
    color: var(--text-primary);
    content: attr(data-text);
    margin-right: 4px;
    opacity: 0.8;
}

.postCardCat a {
    text-decoration: none;
    font-weight: 500;
    color: var(--text-primary);
    transition: opacity 0.2s ease;
}

.postCardCat a:hover {
    text-decoration: underline;
}

.postCardTitle {
    font-size: 1.15rem;
    line-height: 1.45em;
    margin: 0 0 10px;
    font-weight: 600;
}

.postCardTitle a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.postCardTitle a:hover,
.postCard:hover .postCardTitle a {
    text-decoration: underline;
}

.postCardExcerpt {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 14px;
    flex: 1;
    opacity: 0.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
}

.postCardFooter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    margin-top: auto;
    padding-top: 4px;
}

.postCardDate {
    color: var(--text-primary);
    opacity: 0.75;
    font-size: 15px;
}

.postCardReadMore {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    opacity: 0;
    transform: translateX(-8px);
    transition: all 0.25s ease;
}

.postCard:hover .postCardReadMore {
    opacity: 1;
    transform: translateX(0);
}

/* =========================================
   Modern News Style Category Boxes (Homepage)
   ========================================= */

.portal-container {
    padding: 15px;
    background-color: var(--bg-primary);
}

.job-portal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 2 columns for better width on desktop */
    gap: 15px;
}

.category-box {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ad-box-body {
    padding: 12px 15px;
}

.category-header {
    background-color: transparent;
    color: var(--text-primary);
    padding: 12px 15px 5px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    /* Added gap between title and view all link */
}

.category-title {
    margin: 0;
    font-size: 17px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    /* Prevent wrapping and show ellipsis */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

/* Category Header Icon styling (matched to Trending box) */
.category-icon {
    vertical-align: middle;
    margin-left: 5px;
    margin-top: -2px;
    color: var(--text-primary);
}

.view-all-link {
    color: var(--primary-color) !important;
    text-decoration: none !important;
    font-size: 15px;
    font-weight: var(--font-weight-medium);
}

.view-all-link:hover {
    text-decoration: underline !important;
}

.portal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

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

.portal-item:hover {
    background-color: var(--bg-hover);
}

.portal-item-text {
    flex: 1;
    min-width: 0;
}

.portal-item-link {
    color: var(--text-primary) !important;
    text-decoration: none !important;
    font-weight: var(--font-weight-medium);
    line-height: 1.3125;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 15px;
}

.portal-item-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.portal-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.new-badge {
    background-color: var(--primary-color);
    color: white;
    font-size: 9px;
    padding: 4px 6px;
    border-radius: 12px;
    font-weight: var(--font-weight-medium);
    margin-right: 4px;
    vertical-align: middle;
}

/* Error/Empty states */
.no-items,
.error-loading {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* =========================================
   Utility Styles
   ========================================= */





/* =========================================
   Promo Card (Homepage Category Grid)
   ========================================= */
.promo-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 3px solid transparent;
    border-radius: 12px;
    background: linear-gradient(var(--bg-primary), var(--bg-primary)) padding-box, linear-gradient(90deg, #ee46bc, #fcb24f) border-box;
}

.promo-card-bg-gradient {
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(var(--primary-color-rgb), 0.15) 0%, rgba(var(--primary-color-rgb), 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.promo-card-content {
    flex: 1;
    padding: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.promo-icon-container {
    background: rgba(var(--primary-color-rgb), 0.1);
    width: 68px;
    height: 68px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--primary-color);
    transform: rotate(-5deg);
    transition: transform 0.3s ease;
    cursor: default;
}

.promo-icon-container:hover {
    transform: rotate(0deg) scale(1.08);
}

.promo-title {
    font-size: 20px;
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin: 0;
}

.promo-desc {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 28px;
    line-height: 1.5;
}

.promo-stats {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.promo-stat-item {
    text-align: left;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 12px;
}

.promo-stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.promo-stat-value {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold);
    line-height: 1.2;
}

.promo-stat-live {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.promo-stat-live-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.promo-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #1fbf75;
    box-shadow: 0 0 0 0 rgba(31, 191, 117, 0.6);
    display: inline-block;
    margin: 0;
    animation: promoLivePulse 1.8s infinite;
    margin-bottom: 5px;
}

@keyframes promoLivePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(31, 191, 117, 0.6);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(31, 191, 117, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(31, 191, 117, 0);
    }
}

.promo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(90deg, #ee46bc 0%, #fcb24f 100%) !important;
    color: #fff !important;
    padding: 10px 18px;
    border-radius: 50px;
    border: none;
    font-weight: var(--font-weight-normal);
    font-size: 16px;
    box-sizing: border-box;
    transition: transform 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}

.promo-btn:hover {
    background: linear-gradient(90deg, #fcb24f 0%, #ee46bc 100%) !important;
}

/* ==========================================================================
   Responsive Media Queries
   ========================================================================== */

/* 2. Tablet Landscape / Small Laptop */
@media (max-width: 1024px) {
    .portal-container {
        padding: 15px 0 0 0;
    }

    .job-portal-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 5px;
    }

    .category-box {
        border: none;
        border-radius: 12px;
    }

    .category-header {
        padding: 12px 15px;
    }

    .postCardThumb {
        width: 260px;
    }

    .postCardBody {
        padding: 14px 18px;
    }

    .promo-card {
        border-bottom: 3px solid var(--primary-color);
        border-left: 0;
        border-radius: 0;
        border-right: 0;
    }
}

/* 3. Tablet */
@media (max-width: 768px) {
    .category-header {
        padding: 10px 12px;
    }

    .postCard {
        flex-direction: column;
    }

    .postCardThumb {
        width: 100%;
        aspect-ratio: 16 / 9;
    }

    .postCardBody {
        padding: 14px 16px;
    }

    .postCardCat,
    .postCardExcerpt,
    .postCardFooter,
    .postCardDate,
    .postCardReadMore {
        font-size: 14px;
    }

    .postCardReadMore {
        opacity: 1;
        transform: none;
    }
}

/* 4. Mobile */
@media (max-width: 480px) {
    .content-grid {
        gap: 8px;
    }

    .postsGrid {
        gap: 12px;
        margin-bottom: 18px;
    }

    .postCard {
        border-radius: 0;
        border: 0;
    }

    .postCard:hover {
        background: var(--bg-secondary);
    }

    .postCardBody {
        padding: 12px 14px;
    }

    .postCardTitle {
        font-size: 1.02rem;
        line-height: 1.38em;
        margin-bottom: 8px;
    }

    .postCardExcerpt {
        margin-bottom: 10px;
        line-height: 1.5;
    }
}

/* 5. Very Small Mobile */
@media (max-width: 360px) {
    .postCardBody {
        padding: 10px 12px;
    }

    .postCardTitle {
        font-size: 0.95rem;
    }

    .postCardExcerpt {
        -webkit-line-clamp: 2;
    }
}