@import url('root.css');

@media (min-width: 576px) {
    .btn-warning-custom {
        border: none;
        border-radius: 30px;
        color: white;
    }
}

#container-big {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================================
   Hero Section
   ============================================ */
#hero-section {
    border-radius: 20px;
    width: 100%;
    margin: auto;
    margin-top: 25px;
    background-image: url('/cbt/images/banner/bnr_articles_overview_cover.jpeg');
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(26, 84, 186, 0.88) 0%, rgba(26, 84, 186, 0.78) 100%);
    z-index: 0;
}

#hero-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

#blue-background {
    padding: 100px 50px;
    margin-top: auto;
    margin-bottom: auto;
    color: #ffffff;
    background: transparent;
    position: relative;
    z-index: 1;
}

#blue-overlay {
    position: relative;
    z-index: 1;
}

.hero-paragraph {
    font-size: 3rem;
    line-height: 1.2;
    font-weight: 800;
    margin-bottom: 1.2rem;
    margin-top: 20px;
    color: rgb(255, 255, 255);
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4);
    letter-spacing: -0.5px;
}

#blue-overlay h2 {
    color: rgba(255, 255, 255, 0.98);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 25px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.5;
}

#blue-overlay .btn-success {
    background-color: rgba(61, 134, 68, 0.95);
    border: none;
    border-radius: 25px;
    padding: 8px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-right: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#blue-overlay .btn-success:hover {
    background-color: rgb(61, 134, 68);
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#time {
    display: flex;
    align-items: center;
    margin: 25px 0px 30px;
    gap: 10px;
}

#time p {
    color: rgb(255, 255, 255);
    font-size: 16px;
    margin: 0;
    font-weight: 400;
}

#author {
    align-items: center !important;
    display: flex !important;
    flex-direction: row;
    gap: 15px;
}

#author-img {
    width: 60px;
    height: 60px;
    vertical-align: middle;
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#author-name {
    padding: 0px 10px;
    color: rgb(255, 255, 255);
    text-align: left;
    font-size: 1.1rem;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* ============================================
   Welcome Section
   ============================================ */
.main-topic-content {
    color: var(--text-dark);
    font-weight: 700;
    font-size: 2.5rem;
    line-height: 1.3;
    margin-bottom: 30px;
    margin-top: 40px;
    text-align: center;
    font-family: var(--default-font);
}

/* ============================================
   Search Bar - Trendy Style like FAQs
   ============================================ */
#articles-overview-search-row {
    margin: 40px 0;
    padding: 0 15px;
}

#articles-overview-search-form {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

#articles-overview-search-form .input-group {
    position: relative;
    display: flex;
    align-items: center;
}

#articles-overview-search-form .input-group .fa-search {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1.2rem;
    z-index: 3;
    pointer-events: none;
}

/* Ensure search icon stays in place on all screen sizes */
#articles-overview-search-form .input-group {
    position: relative;
}

#articles-overview-search-form .form-control {
    border: 2px solid var(--border-gray);
    border-radius: 50px;
    padding: 18px 130px 18px 55px;
    font-size: 1.1rem;
    font-family: var(--default-font);
    transition: all 0.3s ease;
    background-color: var(--light-gray);
    width: 100%;
}

#articles-overview-search-form .form-control:focus {
    border-color: var(--primary-green);
    background-color: var(--white);
    box-shadow: 0 0 0 3px rgba(61, 134, 68, 0.1);
    outline: none;
}

#articles-overview-search-form .input-group-append {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

#articles-overview-search-submit-btn {
    border-radius: 50px;
    padding: 12px 30px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 2px solid var(--primary-green);
    box-shadow: 0 2px 8px rgba(61, 134, 68, 0.2);
}

#articles-overview-search-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(61, 134, 68, 0.3);
}

/* ============================================
   Article Cards
   ============================================ */
.box {
    border: 0px solid #ccc;
    padding-bottom: 20px;
    margin: 15px 10px;
    border-radius: 15px;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background-color: var(--white);
    overflow: hidden;
}

.box:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Dark mode news box elevation */
[data-theme="dark"] .box {
    background-color: var(--card-bg) !important;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1), 0 2px 6px rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .box:hover {
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.15), 0 4px 12px rgba(255, 255, 255, 0.1) !important;
    transform: translateY(-8px);
}

.box img {
    width: 100%;
    border-radius: 15px 15px 0px 0px;
    margin: 0;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
    object-fit: cover;
    height: 200px;
}

.box:hover img {
    transform: scale(1.05);
}

.btn-content {
    height: 35px;
    justify-content: center;
    text-align: center;
    align-items: center;
    margin-left: 20px;
    margin-bottom: 15px;
    background-color: rgba(61, 134, 68, 0.4);
    border: 0px solid rgba(61, 134, 68, 0.4);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-content:hover {
    background-color: var(--primary-green);
    border: 0px solid var(--primary-green);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(61, 134, 68, 0.3);
}

.topic-content {
    margin-left: 20px;
    margin-right: 20px;
    margin-bottom: 75px;
    padding-bottom: 10px;
    color: var(--text-dark);
    font-weight: 700;
    font-size: 1.4rem;
    line-height: 1.4;
    min-height: 80px;
    max-height: 110px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    transition: color 0.3s ease;
}

.topic-content:hover {
    color: var(--primary-green);
}

.sub-text {
    color: var(--text-light);
    padding: 10px;
    font-weight: 400;
    font-size: 0.9rem;
}

.clock-icon {
    font-size: 14px;
    vertical-align: middle;
    position: absolute;
    bottom: 50px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 4px 10px;
    border-radius: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.opposite-content {
    display: flex;
    align-items: center;
    position: absolute;
    bottom: 15px;
    right: 20px;
    gap: 8px;
}

.opposite-content p {
    margin: 0;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.9rem;
}

.opposite-content img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid var(--border-gray);
    object-fit: cover;
    transition: all 0.3s ease;
}

.box:hover .opposite-content img {
    border-color: var(--primary-green);
    transform: scale(1.1);
}

/* ============================================
   Trending Articles Box
   ============================================ */
.border-container {
    position: relative;
    border: 3px solid var(--primary-green);
    padding: 20px;
    margin: 20px;
    border-radius: 20px;
    background-color: var(--white);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.border-container::before {
    content: "Trending ⚡ Articles";
    display: block;
    position: absolute;
    top: -15px;
    left: 20px;
    background-color: var(--white);
    padding: 5px 15px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-green);
    border-radius: 20px;
}

.trending-article-thumbnail-cell {
    width: 45%;
    vertical-align: middle;
}

.trending-article-thumbnail {
    display: inline-block;
    overflow: hidden;
    border: 2px solid var(--border-gray);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 8px;
    transition: all 0.3s ease;
}

.trending-article-thumbnail:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-green);
}

.trending-article-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.trending-article-thumbnail:hover img {
    transform: scale(1.05);
}

.border-container table td {
    vertical-align: middle;
    padding: 10px;
}

.border-container table td a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

.border-container table td a:hover {
    color: var(--primary-green);
    text-decoration: underline;
}

.border-container table td b {
    font-size: 1rem;
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

/* ============================================
   See More Button
   ============================================ */
#see-more-articles-btn {
    margin: 40px 0;
    padding: 15px 50px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(61, 134, 68, 0.3);
}

#see-more-articles-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(61, 134, 68, 0.4);
}

/* ============================================
   Search Results
   ============================================ */
.search-article-result-thumbnail-cell {
    width: 15%;
}

.search-article-result-thumbnail {
    display: inline-block;
    overflow: hidden;
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
    margin: 8px;
}

.search-article-result-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   Responsive Design
   ============================================ */
@media only screen and (max-width: 992px) {
    #container-big {
        width: 95%;
    }

    .hero-paragraph {
        font-size: 2rem;
    }

    #blue-background {
        padding: 60px 30px;
    }

    .main-topic-content {
        font-size: 2rem;
    }

    .topic-content {
        font-size: 1.2rem;
        min-height: 60px;
    }
}

@media only screen and (max-width: 768px) {
    .hero-paragraph {
        font-size: 1.6rem;
    }

    #blue-overlay h2 {
        font-size: 1.1rem;
    }

    #blue-background {
        padding: 50px 20px;
    }

    .main-topic-content {
        font-size: 1.8rem;
        margin-top: 30px;
    }

    .box {
        margin: 10px 5px;
    }

    .topic-content {
        font-size: 1.1rem;
        margin-bottom: 75px;
        max-height: 90px;
    }

    #articles-overview-search-form .form-control {
        padding: 15px 120px 15px 50px;
        font-size: 1rem;
    }

    #articles-overview-search-submit-btn {
        padding: 10px 25px;
        font-size: 0.9rem;
    }

    /* Ensure button doesn't overlap on tablets */
    #articles-overview-search-form .input-group-append {
        right: 5px;
    }

    .border-container {
        margin: 15px 10px;
    }

    .trending-article-thumbnail-cell {
        width: auto;
        display: block;
        margin-bottom: 10px;
    }

    .search-article-result-thumbnail-cell {
        width: auto;
    }

    #see-more-articles-btn {
        padding: 12px 40px;
        font-size: 1rem;
    }
}

@media only screen and (max-width: 576px) {
    .hero-paragraph {
        font-size: 1.6rem;
        line-height: 1.3;
    }

    #blue-overlay h2 {
        font-size: 1.1rem;
    }

    #blue-background {
        padding: 50px 20px;
    }

    #time {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    #author {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-topic-content {
        font-size: 1.5rem;
    }

    #articles-overview-search-form .input-group {
        flex-direction: column;
        align-items: stretch;
        position: relative;
    }

    /* Wrap input in relative container for icon positioning */
    #articles-overview-search-form .form-control {
        border-radius: 50px;
        padding: 15px 20px 15px 50px;
        margin-bottom: 10px;
        width: 100%;
        box-sizing: border-box;
        position: relative;
    }

    /* Position icon relative to the input field, not the container */
    /* Input field padding: 15px top, so icon center = 15px (top padding) + half of input height */
    /* Using calc to position icon at center of input: top padding + approximate half height */
    #articles-overview-search-form .input-group .fa-search {
        position: absolute !important;
        left: 20px !important;
        /* Center icon in input: 15px (top padding) + ~12px (half of ~24px line-height) */
        top: calc(15px + 5px) !important;
        transform: none !important;
        z-index: 10 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Ensure input-group maintains proper positioning context */
    #articles-overview-search-form .input-group {
        position: relative !important;
    }

    #articles-overview-search-form .input-group-append {
        position: static !important;
        transform: none !important;
        width: 100%;
        margin-top: 0;
    }

    #articles-overview-search-submit-btn {
        border-radius: 50px;
        width: 100%;
        padding: 12px 20px;
        box-sizing: border-box;
    }

    .topic-content {
        margin-bottom: 70px;
        max-height: 80px;
    }
}
