/* Custom Styles for News Portal (to complement Bootstrap) */

body {
    font-family: 'Inter', sans-serif;
    background-color: #f4f7f6; /* Light background */
}

/* Header */
.navbar-brand {
    font-size: 1.8rem !important; /* Make logo slightly larger */
}

.navbar-nav .nav-link {
    padding: 0.5rem 1rem; /* Adjust padding for nav links */
    border-radius: 0.375rem; /* Match Bootstrap's default rounded corners */
    transition: background-color 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1); /* Light background on hover/active */
}


/* Auth Forms (Login/Register) */
.auth-form {
    background-color: #fff;
    padding: 20px; /* Reduced from 30px */
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 20px; /* Reduced from 30px */
    color: #34495e;
}

/* Homepage Layout */
.homepage-main {
    /* Bootstrap's grid system will handle the flex behavior */
}

/* Fixed height for the top row containing slider and login */
.top-section-fixed-height {
    height: 380px; /* This height aims to encompass both slider and login form */
    display: flex; /* Ensure it's a flex container */
    align-items: stretch; /* Make children stretch to this height */
}

/* News Slider (Bootstrap Carousel specific styling) */
.carousel-item { /* Apply fixed height to the carousel item itself */
    height: 350px; /* Reverted to 350px for better image composition */
    min-height: 350px; /* Ensure minimum height */
    max-height: 350px; /* Ensure maximum height */
    position: relative; /* Ensures child img's height:100% works correctly */
}

.carousel-item img {
    width: 100%; /* Ensure it fills the item width */
    height: 100%; /* Ensure it fills the item height */
    object-fit: cover; /* Crop to fill while maintaining aspect ratio */
    border-radius: 8px;
}

.carousel-caption {
    background-color: rgba(0, 0, 0, 0.6); /* Semi-transparent background for caption */
    padding: 15px; /* Padding inside the caption */
    border-radius: 8px;
    bottom: 20px; /* Position caption slightly up */
    left: 10%; /* Keep it narrower */
    right: 10%; /* Keep it narrower */
    width: 80%; /* Keep it narrower */
    margin: auto;
    text-align: center; /* Center align text within caption */
}

.carousel-caption h5 {
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7); /* Retained text-shadow for slider */
}

.carousel-caption p {
    color: #f8f9fa;
    font-size: 1rem;
    margin-bottom: 0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7); /* Retained text-shadow for slider */
}

.slider-placeholder { /* For cases where no image is available */
    height: 350px; /* Fixed height to match carousel-item */
    min-height: 350px; /* Ensure minimum height */
    max-height: 350px; /* Ensure maximum height */
    background-color: #e9ecef;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    color: #6c757d;
    text-align: center;
}


/* News List by Categories */
.news-category-section h3 {
    border-bottom: 2px solid #0d6efd; /* Bootstrap primary color */
    padding-bottom: 10px;
    margin-bottom: 20px;
    color: #34495e;
}

/* New Category Layout Styles */
.category-news-grid {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 20px; /* Space between main card and list */
}

.category-main-card {
    flex: 2; /* Takes 2 parts of the available space */
    min-width: 60%; /* Ensure it doesn't get too small */
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
    position: relative;
    color: #fff; /* Text color for overlay */
    min-height: 400px; /* Minimum height for the main card */
    display: flex;
    align-items: flex-end; /* Align content to bottom */
}

.category-main-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    border-radius: 8px;
}

.category-main-card .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 50%);
    z-index: 2;
    border-radius: 8px;
}

.category-main-card-content {
    position: relative;
    z-index: 3;
    width: 100%;
    text-align: left; /* Align text to left within content */
}

/* Specific text band for category main card */
.category-main-card-content .text-band {
    background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent black background */
    padding: 15px 20px; /* Padding inside the band */
    display: inline-block; /* Make it a block element that wraps content */
    width: 100%; /* Take full width of its parent */
    box-sizing: border-box; /* Include padding in width */
}

.category-main-card-content h4 {
    color: #fff; /* Explicitly set to white */
    font-size: 1.8rem;
    margin-bottom: 10px;
    text-shadow: none; /* Removed text-shadow as solid background provides contrast */
}

.category-main-card-content h4 a { /* Target the link inside h4 */
    color: #fff; /* Set link color to white */
    text-decoration: none; /* Remove underline by default */
}

.category-main-card-content h4 a:hover {
    color: #eee; /* Slightly darker white on hover for subtle effect */
    text-decoration: underline; /* Add underline on hover */
}


.category-main-card-content p {
    color: #f8f9fa; /* Off-white text */
    font-size: 1rem;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: none; /* Removed text-shadow */
}

.category-main-card-content .read-more {
    display: inline-block;
    background-color: #0d6efd;
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}

.category-main-card-content .read-more:hover {
    background-color: #0b5ed7;
    text-decoration: none;
}


.category-small-list {
    flex: 1; /* Takes 1 part of the available space */
    min-width: 300px; /* Minimum width for the list */
    display: flex;
    flex-direction: column;
    gap: 15px; /* Space between small news items */
}

.small-news-item {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    padding: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.small-news-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.small-news-item img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0; /* Prevent image from shrinking */
    margin-right: 15px;
}

.small-news-item-content {
    flex-grow: 1;
}

.small-news-item-content h5 {
    font-size: 1.05rem;
    margin-bottom: 5px;
    color: #2c3e50;
}

.small-news-item-content h5 a {
    color: #2c3e50;
    text-decoration: none;
}

.small-news-item-content h5 a:hover {
    color: #0d6efd;
    text-decoration: underline;
}

.small-news-item-content .time-ago {
    font-size: 0.85em;
    color: #777;
}

.small-news-item-content .time-ago i {
    margin-right: 5px;
}

.category-load-more-btn {
    text-align: right;
    margin-top: 20px;
}

/* Existing News Card Styles (for general news list, if any) */
.news-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column; /* Ensure content stacks */
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.news-card img {
    width: 100%;
    height: 200px; /* Fixed height for thumbnails */
    object-fit: cover;
    display: block;
}

.news-card-content {
    padding: 15px;
    flex-grow: 1; /* Allow content to take available space */
    display: flex;
    flex-direction: column;
}

.news-card h4 {
    font-size: 1.3em;
    margin-bottom: 10px;
    color: #2c3e50;
}

.news-card p {
    font-size: 0.95em;
    color: #666;
    margin-bottom: 15px;
    flex-grow: 1; /* Allow description to take available space */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limit description to 3 lines */
    -webkit-box-orient: vertical;
}

.news-card .read-more {
    display: inline-block;
    background-color: #0d6efd; /* Bootstrap primary color */
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.9em;
    align-self: flex-start; /* Align button to the start */
    transition: background-color 0.3s ease;
}

.news-card .read-more:hover {
    background-color: #0b5ed7;
    text-decoration: none;
}

/* Dashboard Layouts */
.dashboard-layout {
    display: flex;
    min-height: calc(100vh - 120px); /* Adjust based on header/footer height */
}

.sidebar {
    width: 220px;
    background-color: #34495e; /* Darker shade for sidebar */
    color: #ecf0f1;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    flex-shrink: 0; /* Prevent sidebar from shrinking */
}

.sidebar h3 {
    color: #ecf0f1;
    margin-bottom: 30px;
    text-align: center;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li {
    margin-bottom: 10px;
}

.sidebar ul li a {
    display: block;
    color: #ecf0f1;
    padding: 12px 15px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
    background-color: #0d6efd; /* Bootstrap primary color */
    text-decoration: none;
}

.main-content {
    flex-grow: 1;
    padding: 30px;
    background-color: #f9f9f9;
}

.main-content h2 {
    margin-bottom: 30px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

/* Profile Image Display */
.profile-img-thumb {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ddd;
}

/* Specific style for news detail page content */
.news-description {
    font-size: 22px; /* Adjusted font size for news detail content */
    line-height: 1.6; /* Improve readability with increased font size */
    color: #333; /* Ensure good contrast */
    text-align: justify; /* Justify text alignment */
}

/* Sticky Notice Bar */
.sticky-notice-bar {
    position: sticky;
    top: 0; /* Stick to the top of the viewport */
    z-index: 1020; /* Ensure it's above other content but below navbar (navbar is 1030) */
    width: 100%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 10px; /* Added 10px bottom margin */
}

.sticky-notice-bar .carousel-control-prev,
.sticky-notice-bar .carousel-control-next {
    width: 3%; /* Make controls narrower */
    opacity: 0.8; /* Slightly less opaque */
}

.sticky-notice-bar .carousel-control-prev-icon,
.sticky-notice-bar .carousel-control-next-icon {
    font-size: 0.8rem; /* Smaller icons */
}

.sticky-notice-bar .carousel-item {
    height: auto; /* Allow height to adjust to content */
    min-height: 25px; /* Minimum height for a single line */
    max-height: 50px; /* Max height for two lines before scrolling */
    overflow: hidden; /* Hide overflow if content is too long */
    display: flex;
    align-items: center;
}

.sticky-notice-bar .notice-content {
    white-space: nowrap; /* Keep content on a single line */
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Add ellipsis for overflow */
}

/* Top 4 News Titles Section (Professional Design) */
.top-news-titles-container {
    background-color: #ffffff; /* White background for the container */
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    padding: 20px 30px; /* Increased horizontal padding */
    margin-bottom: 30px; /* Space below this section */
}

.top-news-item {
    border-bottom: 1px solid #e0e0e0; /* Lighter, more subtle separator */
    padding: 20px 0; /* Increased vertical padding */
    margin-bottom: 0; /* Remove default margin */
    text-align: center; /* Center align all content within the item */
}

.top-news-item:first-child {
    padding-top: 0; /* No top padding for the very first item */
}

.top-news-item:last-child {
    border-bottom: none; /* No border for the last item */
    padding-bottom: 0; /* No bottom padding for the last item */
}

.top-news-item h5 { /* Changed from h1 to h5 for semantic correctness */
    font-size: 60px; /* Set to 60px as requested */
    font-weight: bold;
    margin-bottom: 8px; /* Space between title and meta */
    line-height: 1.3; /* Adjusted line height for readability */
}

.top-news-item h5 a { /* Target the link inside h5 */
    color: #000; /* Set link color to black */
    text-decoration: none; /* Remove underline by default */
    transition: color 0.2s ease; /* Keep color transition */
}

.top-news-item h5 a:hover {
    color: #333; /* Slightly lighter black on hover for subtle effect */
    text-decoration: none; /* Ensure no underline on hover as well */
}

.top-news-meta {
    font-size: 0.9em; /* Keep current font size for meta info */
    color: #777; /* Standard gray for meta text */
    display: flex; /* Use flex for horizontal alignment */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
    gap: 8px; /* Space between elements */
    margin-top: 0; /* Removed previous margin */
}

.top-news-meta .source-icon {
    width: 18px; /* Smaller icon size */
    height: 18px;
    background-color: #ff4500; /* Example color, could be more subtle */
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.7em; /* Smaller font inside icon */
    font-weight: bold;
}

/* New: Second Highlight with Image Section */
.second-highlight-news-container {
    background-color: #ffffff; /* White background for the container */
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    padding: 30px; /* Generous padding */
    margin-bottom: 30px; /* Space below this section */
}

.second-highlight-item {
    margin-bottom: 40px; /* Space between each news item */
}

.second-highlight-item:last-child {
    margin-bottom: 0; /* No bottom margin for the last item */
}

.second-highlight-item h5 {
    font-size: 2.5rem; /* Large title for this section */
    font-weight: bold;
    color: #000; /* Black color for title */
    margin-bottom: 10px;
    line-height: 1.3;
    text-align: center; /* Center align title */
}

.second-highlight-item h5 a {
    color: #000; /* Black link color */
    text-decoration: none; /* No underline */
    transition: color 0.2s ease;
}

.second-highlight-item h5 a:hover {
    color: #333; /* Subtle hover effect */
    text-decoration: none; /* No underline on hover */
}

.second-highlight-meta {
    font-size: 0.9em;
    color: #777;
    display: flex;
    justify-content: center; /* Center align meta */
    align-items: center;
    gap: 8px;
    margin-bottom: 20px; /* Space below meta and before image */
}

.second-highlight-meta .source-icon {
    width: 18px;
    height: 18px;
    background-color: #ff4500; /* Consistent icon style */
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.7em;
    font-weight: bold;
}

.second-highlight-image-wrapper {
    margin-bottom: 20px; /* Space below image and before description */
    text-align: center; /* Ensure image is centered if it's smaller than container */
}

.second-highlight-image-wrapper img {
    max-width: 100%; /* Ensure image is responsive */
    height: auto;
    display: block; /* Remove extra space below image */
    margin: 0 auto; /* Center the image */
}

.second-highlight-image-placeholder {
    background-color: #e9ecef;
    min-height: 250px; /* Placeholder height */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.2em;
    margin-bottom: 20px;
}

.second-highlight-description {
    font-size: 1.1em; /* Slightly larger font for description */
    line-height: 1.6;
    color: #333;
    text-align: justify; /* Justify text for a professional look */
}


/* Responsive adjustments for dashboard sidebar */
@media (max-width: 991px) { /* Adjust breakpoint for tablet */
    .category-news-grid {
        flex-direction: column; /* Stack main card and small list */
    }

    .category-main-card,
    .category-small-list {
        min-width: unset; /* Remove min-width */
        flex: none; /* Remove flex sizing */
        width: 100%; /* Take full width */
    }

    .top-news-item h5 { /* Adjusted for tablet */
        font-size: 48px; /* Adjusted for smaller screens (was 42px) */
    }

    .second-highlight-item h5 {
        font-size: 2rem; /* Adjust title size for tablet */
    }
}

@media (max-width: 768px) { /* Adjust breakpoint for mobile */
    .dashboard-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 15px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    .top-section-fixed-height {
        height: auto; /* Remove fixed height on small screens */
        flex-direction: column; /* Stack columns */
    }

    .carousel-item, .slider-placeholder {
        height: 250px; /* Adjust slider height for mobile */
        min-height: 250px;
        max-height: 250px;
    }

    .category-main-card {
        min-height: 300px; /* Adjust main card height for mobile */
    }

    .category-main-card-content h4 {
        font-size: 1.5rem;
    }

    .news-description {
        font-size: 20px; /* Slightly smaller font for mobile readability */
    }

    .sticky-notice-bar {
        top: 56px; /* Adjust top position for mobile navbar height */
        margin-bottom: 10px; /* Added 10px bottom margin for mobile */
    }

    .top-news-item h5 { /* Adjusted for mobile */
        font-size: 38px; /* Adjusted for smaller screens (was 32px) */
    }

    .top-news-titles-container {
        padding: 15px 20px; /* Adjust padding for mobile */
    }

    .second-highlight-news-container {
        padding: 20px; /* Adjust padding for mobile */
    }

    .second-highlight-item h5 {
        font-size: 1.8rem; /* Adjust title size for mobile */
    }

    .second-highlight-image-placeholder {
        min-height: 180px; /* Adjust placeholder height for mobile */
    }
}


.navbar-nav .dropdown-menu {

position:normal;
}