/* --- Root Variables --- */
:root {
    --primary-color: #008000;
    --secondary-color: #f8f9fa;
    --text-dark: #202124;
    --text-light: #70757a;
    --white: #ffffff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --w_long: 99%;
}

/* Base Styles */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Sarabun', 'Tahoma', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #FFFFFF;
    color: var(--text-dark);
    line-height: 1.6;
}

/* myweb_navbar Styles */
.myweb_navbar {
    background: var(--primary-color);
    box-shadow: var(--shadow);
    z-index: 1000;
}

.myweb_nav-container {
    max-width: var(--w_long);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 65px;
    padding: 0 20px;
}

.logo {
    font-weight: bold;
    font-size: 1.4em;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
}

/* Hamburger Menu Icon (Mobile Only) */
.menu-toggle_myweb {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
    padding: 10px;
}

.menu-toggle_myweb span {
    width: 24px;
    height: 3px;
    background: var(--white);
    border-radius: 2px;
}

/* Desktop Menu Navigation */
.nav-menu_myweb {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item_myweb {
    position: relative;
}

.nav-link_myweb {
    text-decoration: none;
    color: var(--white);
    padding: 0 18px;
    line-height: 65px;
    display: block;
    font-weight: 500;
    transition: background 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.nav-link_myweb:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

/* Dropdown Content */
.dropdown-content {
    display: none;
    position: absolute;
    top: 65px;
    left: 0;
    background: var(--primary-color);
    min-width: 250px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-radius: 0 0 8px 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1001;
}

.dropdown-header {
    background: rgba(0, 0, 0, 0.1);
    padding: 8px 20px;
    font-weight: bold;
    font-size: 0.9em;
    color: var(--white);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-content a {
    color: var(--white);
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-content a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

.nav-item_myweb:hover .dropdown-content {
    display: block;
}

/* Main Layout Container */
.myweb_container {
    max-width: var(--w_long);
    margin: 20px auto;
    padding: 0 15px;
}

.myweb_card {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

/* News List (Feed) Style */
.news-item {
    padding: 15px 0;
    border-bottom: 1px solid #edf0f2;
    transition: transform 0.1s;
}

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

.news-item a {
    text-decoration: none;
    color: var(--text-dark);
    font-size: 1.15em;
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.news-item:hover a {
    color: var(--primary-color);
}

.news-date {
    font-size: 0.85em;
    color: var(--text-light);
}

/* News Detail Style */
.news-title {
    font-size: 1.8em;
    margin-bottom: 10px;
    line-height: 1.3;
}

.main-img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 15px 0;
    object-fit: cover;
}

.content-body {
    font-size: 1.15em;
    color: #333;
    line-height: 1.8;
}

/* Buttons */
.btn-back {
    display: inline-flex;
    align-items: center;
    background: #e8f0fe;
    color: var(--primary-color);
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 20px;
    transition: 0.2s;
}

.btn-back:hover {
    background: #d2e3fc;
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    padding: 10px 18px;
    margin: 0 3px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-decoration: none;
    color: var(--primary-color);
    background: var(--white);
}

.pagination .active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.pagination .disabled {
    color: #ccc;
    pointer-events: none;
}

/* Mobile Responsive Rules */
@media (max-width: 768px) {
    .menu-toggle_myweb {
        display: flex;
        margin-left: auto;
    }

    .nav-menu_myweb {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 65px;
        left: 0;
        width: 100%;
        background: var(--primary-color);
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
    }

    .nav-menu_myweb.active {
        display: flex;
    }

    .nav-link_myweb {
        line-height: 55px;
        padding-left: 25px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        max-width: none;
        white-space: normal;
        color: var(--white) !important;
    }

    .nav-link_myweb:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .dropdown-content {
        position: static;
        box-shadow: none;
        border-top: none;
        background: rgba(0, 0, 0, 0.1);
        display: none;
    }

    .nav-item_myweb.active .dropdown-content {
        display: block;
    }

    .dropdown-content a {
        padding-left: 45px;
    }

    .news-title {
        font-size: 1.5em;
    }

    .container {
        margin: 10px auto;
    }

    .card {
        padding: 15px;
    }
}

/* News Card Grid System */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.news-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.card-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #eee;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .card-image img {
    transform: scale(1.1);
}

.card-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--text-dark);
    margin: 0 0 10px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    margin-top: auto;
    font-size: 0.85em;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 5px;
}

@media (max-width: 480px) {
    .news-grid {
        grid-template-columns: 1fr;
    }

    .card-image {
        height: 200px;
    }
}

/* Loading Spinner Style */
.loader-wrapper {
    display: none;
    text-align: center;
    padding: 50px 0;
}

.loader {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-bottom: 10px;
}

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

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

.loader-text {
    display: block;
    color: var(--text-light);
    font-size: 0.9em;
}

/* Link styles */
.news-grid a,
.news-card a,
.card-link {
    text-decoration: none !important;
    color: inherit;
}

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

/* Content area links */
.content-body a {
    text-decoration: none;
    color: var(--primary-color);
    border-bottom: 1px solid transparent;
    transition: 0.2s;
}

.content-body a:hover {
    border-bottom: 1px solid var(--primary-color);
}

/* myweb_navbar styling */
.myweb_navbar {
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1000;
    width: 100%;
}

@media (max-width: 768px) {
    .myweb_navbar {
        top: 0;
        left: 0;
        width: 100%;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
}

/* Body padding for myweb_navbar */
@media (min-width: 769px) {
    body {
        padding-top: 0;
    }
}

/* Category header styles */
.catheader__topic {
    position: relative;
    height: 32px;
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: 25px;
    clear: both;
}

.catheader__topic .text {
    height: 32px;
    display: flex;
    align-items: center;
    background: var(--primary-color);
    color: #fff;
    padding: 0 15px;
    font-size: 14pt;
    font-weight: 700;
    float: left;
}

.catheader__topic .arrow {
    width: 0;
    height: 0;
    border-top: 0px solid transparent;
    border-bottom: 30px solid #045804;
    border-right: 20px solid transparent;
    float: left;
}

.catheader__topic::after {
    content: "";
    display: table;
    clear: both;
}

/* News list container layout */
.news-list-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    padding: 0;
}

/* News grid main area */
.news-grid-main {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 15px;
}

/* Three column grid */
.news-grid-three {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
}

/* News list item card */
.news-list-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.news-list-item:hover {
    background-color: #f8f9fa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* News text content */
.news-text-content {
    flex: 1;
    padding-right: 15px;
}

.news-list-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-list-title a {
    text-decoration: none;
    color: inherit;
    display: block;
}

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

.news-list-info {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 4px;
}

.news-list-views {
    font-size: 0.85rem;
    color: #888;
}

/* News image box */
.news-image-box {
    width: 140px;
    height: 90px;
    flex-shrink: 0;
}

.news-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .news-list-container {
        grid-template-columns: 1fr;
    }

    .news-image-box {
        width: 110px;
        height: 75px;
    }

    .news-list-title {
        font-size: 0.95rem;
    }
}

/* Menu lists */
ul.v_menu_top {
    padding: 0;
    margin: 0;
    list-style: none;
}

ul.v_menu_top>li {
    float: left;
    display: inline;
    list-style-type: none;
    height: 30px;
    text-align: center;
    bottom: 0;
}

ul.v_menu_top>li:hover {
    display: block;
}

ul.v_menu_top>li>a {
    text-decoration: none;
    background-color: var(--primary-color);
    color: #FFFFFF;
    padding-left: 15px;
    padding-right: 10px;
    line-height: 30px;
    height: 30px;
    display: block;
    clip-path: polygon(15px 0%, 100% 0%, 100% 100%, 0% 100%, 0% 30px);
    position: relative;
}

ul.v_menu_top>li>a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    /* ใช้สีขาวเป็นเส้นขอบ และกำหนดความหนา (เช่น 2px) */
    background-color: #cccccc96;
    /* ใช้ clip-path เดียวกันแต่บีบระยะให้เหลือแค่เส้นด้านซ้าย */
    /* ในที่นี้เราสร้างเส้นที่หนา 2px ขนานไปกับขอบซ้ายที่เอียง */
    clip-path: polygon(15px 0%, 17px 0%, 1px 100%, 0% 100%);
    pointer-events: none;
    /* เพื่อให้คลิกทะลุไปหาตัว a ได้ */
}

.active_top {
    width: 0;
    height: 0;
    padding: 0;
    margin: 0;
    border-style: solid;
    border-width: 0 20px 30px 0;
    border-color: transparent transparent var(--primary-color) transparent;
}

.a_top {
    margin-left: -8px;
}

.menutop {
    max-width: var(--w_long);
    margin: 0 auto;
    display: flex;
    padding: 0 20px;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* Modern content layout */
.main {
    flex: 1;
    min-width: 0;
    font-size: 12px;
}

.menu {
    width: 280px;
    position: sticky;
    top: 20px;
}

@media (max-width: 1200px) {

    .news-grid-main,
    .news-grid-three {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .news-list-container {
        flex-direction: column;
    }

    .menu {
        width: 100%;
        position: static;
        order: 2;
    }

    .main {
        width: 100%;
        order: 1;
    }
}

.sidebar-menu {
    background: #f8f9fa;
    border-radius: 5px;
    box-shadow: none;
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid #eee;
}

.ministry-list {
    list-style: none;
    padding: 5px 0;
    margin: 0;
}

.ministry-list li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #444;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.ministry-list li a:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
    padding-left: 10px;
}

.ministry-list li a i,
.ministry-list li a svg {
    margin-right: 12px;
    color: #888;
    font-size: 0.9rem;
    width: 18px;
    text-align: center;
    transition: all 0.2s;
}

.ministry-list li a:hover i,
.ministry-list li a:hover svg {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* Header SVG icons */
.v_menu_top li a svg {
    color: #fff;
    opacity: 0.9;
    margin-right: 4px;
}

.nav-link_myweb svg {
    transition: transform 0.3s ease;
}

.nav-link_myweb:hover svg {
    transform: translateY(-2px);
}

/* Topic only list styles */
.topic-only-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.topic-only-list li {
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
    cursor: pointer;
    transition: all 0.2s;
}

.topic-only-list li:hover {
    padding-left: 5px;
}

.topic-only-list li a {
    text-decoration: none;
    color: #333;
    font-size: 0.95rem;
    font-weight: 500;
    display: block;
    line-height: 1.4;
}

.topic-only-list li:hover a {
    color: var(--primary-color);
}

.dot {
    color: var(--text-light);
    margin-right: 5px;
    font-weight: bold;
}

.date-small {
    font-size: 0.8rem;
    color: #2b36d3ff;
    margin-top: 2px;
}

/* Small news grid for categories */
.news-grid-small {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.news-grid-small .news-list-item {
    padding: 10px;
}

/* News detail and attachments */
.news-meta-info {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 20px;
}

.main-news-img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 25px auto;

}

.attachment-section {
    margin-top: 30px;
}

.attachment-fieldset {
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    background: #fafafa;
}

.attachment-legend {
    font-weight: bold;
    color: #333;
    font-size: 1rem;
    padding: 0 10px;
}

.attachment-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.attachment-info-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.attachment-icon {
    font-size: 2.5rem;
}

.icon-pdf {
    color: #dc3545;
}

.icon-excel {
    color: #198754;
}

.icon-word {
    color: #0d6efd;
}

.attachment-label {
    font-weight: bold;
    font-size: 1.1rem;
    color: #333;
}

.attachment-size {
    font-size: 0.9rem;
    color: #666;
}

.attachment-download-btn {
    background-color: #f5c71a;
    color: #fff !important;
    text-decoration: none !important;
    padding: 10px 25px;
    border-radius: 5px;
    font-weight: bold;
    display: inline-block;
    transition: background 0.2s;
}

.attachment-download-btn:hover {
    background-color: #e0b618;
}

.attachment-image-container {
    margin-top: 20px;
    text-align: center;
}

.attachment-image {
    max-width: 100%;
    border: 1px solid #eee;
    padding: 5px;
    background: #fff;
}

/* Mobile adjustments for attachments */
@media (max-width: 576px) {
    .attachment-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .attachment-action {
        width: 100%;
    }

    .attachment-download-btn {
        width: 100%;
        text-align: center;
    }

    .menutop {
        max-width: 100%;
    }
}

/* Social share buttons */
.share-container {
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.share-label {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
    color: #555;
    font-size: 1rem;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 50px;
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-facebook {
    background-color: #0866FF;
}

.btn-line {
    background-color: #06C755;
}

.btn-x {
    background-color: #000000;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    filter: brightness(1.1);
}

.share-btn svg {
    font-size: 1.2em;
}

@media (max-width: 576px) {
    .share-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Premium news layout */
.premium-news-section {
    margin-bottom: 40px;
}

.catheader__premium {
    position: relative;
    height: 38px;
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: 20px;
    clear: both;
}

.catheader__premium .text {
    height: 38px;
    display: flex;
    align-items: center;
    background: var(--primary-color);
    color: #fff;
    padding: 0 15px 0 12px;
    font-size: 1.2rem;
    font-weight: 700;
    float: left;
}

.catheader__premium .arrow {
    width: 0;
    height: 0;
    border-top: 0px solid transparent;
    border-bottom: 38px solid #045804;
    border-right: 25px solid transparent;
    float: left;
}

.catheader__premium::after {
    content: "";
    display: table;
    clear: both;
}

.category-grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 30px;
}

.premium-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 0;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}

.category-grid-container .premium-grid {
    grid-template-columns: 1fr;
}

.category-grid-container .premium-featured {
    border-right: none;
    border-bottom: 1px solid #eee;
}

.category-grid-container .featured-image {
    min-height: 200px;
}

@media (max-width: 1200px) {
    .category-grid-container {
        grid-template-columns: 1fr;
    }
}

.premium-featured {
    position: relative;
    border-right: 1px solid #eee;
}

.featured-card {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    text-decoration: none;
    overflow: hidden;
}

.featured-image {
    width: 100%;
    aspect-ratio: 644 / 460;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #fff;
    padding: 0;
    margin: 0;
    display: block;
}

.featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    padding: 2px;
}

.featured-title {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.premium-side-list {
    display: flex;
    flex-direction: column;
}

.side-news-item {
    display: flex;
    padding: 2px 2px;
    border-bottom: 1px dotted #ccc;
    transition: background 0.2s;
    text-decoration: none;
    align-items: center;
    color: inherit;
}

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

.side-news-item:hover {
    background: #f9f9f9;
}

.side-logo {
    width: 130px;
    height: 90px;
    flex-shrink: 0;
    margin-right: 12px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.side-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 0;
    margin: 0;
    display: block;
}

.side-content {
    flex: 1;
    min-width: 0;
}

.side-title {
    margin: 0 0 5px 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #333;
}

.side-news-item:hover .side-title {
    color: var(--primary-color);
}

.side-date {
    font-size: 0.8rem;
    color: #086e0d;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .premium-grid {
        grid-template-columns: 1fr;
    }

    .premium-featured {
        border-right: none;
        border-bottom: 1px solid #eee;
    }



    .catheader__premium .text {
        font-size: 1.1rem;
    }
}

/* Featured image 300px height - Desktop only */
@media (min-width: 769px) {
    .featured-image-300 {
        height: 300px !important;
    }
}

/* On iPad and mobile, responsive images */
@media (max-width: 768px) {
    .featured-image-300 {
        height: auto !important;
    }
}

/* Header Layout */
.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.update-text {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: -5px;
}

/* Login Container in Header */
.login-container {
    display: flex;
    align-items: center;
    margin-left: auto;
    /* Push to far right */
}

.user-info {
    display: flex;
    align-items: center;
    background: #f1f3f4;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #3c4043;
    border: 1px solid #dadce0;
    white-space: nowrap;
}

.user-info span {
    font-weight: 600;
}

.user-info a {
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

.user-info a:hover {
    color: #c5221f;
}

@media (max-width: 768px) {
    .header-flex {
        flex-direction: column;
        text-align: center;
    }

    .logo-section {
        flex-direction: column;
        gap: 10px;
    }
}

/* Consolidated Sidebar Dropdown Styles */
.sidebar-menu-consolidated {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid #f0f0f0;
}

.dropdown-section {
    border-bottom: 1px solid #f5f5f5;
}

.dropdown-section:last-child {
    border-bottom: none;
}

.dropdown-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    background: #fff;
    transition: background 0.3s;
    user-select: none;
}

.dropdown-trigger:hover {
    background: #fcfcfc;
}

.dropdown-trigger .trigger-label {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #333;
    font-size: 1.05rem;
    flex: 1;
    /* Push the chevron to the right */
}

.dropdown-trigger .trigger-label svg {
    margin-right: 12px;
    color: var(--primary-color);
}

.dropdown-trigger .chevron-icon {
    transition: transform 0.3s ease;
    color: #aaa;
}

.dropdown-section.active .dropdown-trigger {
    background: #f9f9f9;
}

.dropdown-section.active .chevron-icon {
    transform: rotate(180deg);
}

.dropdown-content-sidebar {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: #fff;
}

.dropdown-section.active .dropdown-content-sidebar {
    max-height: 800px;
    /* Adjust as needed or use JS to calculate */
    overflow-y: auto;
}

/* Custom scrollbar for long dropdowns */
.dropdown-content-sidebar::-webkit-scrollbar {
    width: 6px;
}

.dropdown-content-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dropdown-content-sidebar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.dropdown-content-sidebar .ministry-list li a {
    padding: 10px 20px 10px 52px;
    font-size: 0.95rem;
}

.login-container {
    position: relative;
    display: inline-block;
}

.user-dropdown-toggle {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: #008000;
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}

.user-dropdown-toggle:hover {
    transform: scale(1.1);
}

.user-dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    min-width: 180px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 10px 0;
    display: none;
    z-index: 9999;
    border: 1px solid #eee;
    margin-top: 10px;
}

.user-dropdown-menu.show {
    display: block;
    animation: dropdownFade 0.2s ease-out;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #333 !important;
    font-size: 0.95rem;
    text-decoration: none !important;
    transition: background 0.2s;
}

.user-dropdown-item:hover {
    background: #f8f9fa;
    color: #008000 !important;
}

.user-dropdown-item i {
    width: 18px;
    text-align: center;
    color: #008000;
}

.user-dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 5px 0;
}