/************************************ General body styling ************************************/
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #FFFFFF; /* White background */
    display: flex;
    justify-content: center;
    color: #000000; /* Black text for better contrast */
}

/************************************ Container for all content to center it ************************************/
.main-container {
    max-width: 1200px; /* Set to desired maximum width */
    margin: 0 auto; /* Centers the content block */
    width: 100%;
    padding: 0 20px; /* Add padding on the left and right */
    box-sizing: border-box; /* Ensures padding is included in width */
}

a {
    text-decoration: none;
}

/************************************ Header styling ************************************/
/* Header styling with language dropdown */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
}

.logo {
    max-width: 200px;
    cursor: pointer; /* Makes the logo feel interactive */
}

/* Translate container styling */
.translate-container {
    display: flex;
    align-items: center;
    background-color: #E0E0E0; 
    border-radius: 20px; /* Rounded corners for the dropdown */
    padding: 5px 10px; /* Padding around the icon and dropdown */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
}

.translate-icon {
    cursor: pointer;
    margin-right: 10px;
    font-size: 24px;
}

.language-dropdown {
    padding: 5px 15px;
    border: none; /* Remove default border */
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer; /* Indicates the dropdown is clickable */
    background-color: transparent; /* Transparent background */
    color: #000000; /* Text color */
}

/************************************ Thick bar styling ************************************/
.thick-bar {
    height: 50px;
    background: #000000; /* Black background */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border-radius: 25px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    font-size: 18px;
}

.navbar .nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 80px;
}

.navbar .nav-links li a {
    text-decoration: none;
    color: #FFFFFF;
    font-weight: bold;
    transition: color 0.3s ease;
}

.navbar .nav-links li a:hover {
    color: #E0E0E0; /* Gold color on hover for better visibility */
}

/************************************ Main content styling ************************************/
.main-content {
    display: flex;
    align-items: flex-start; /* Aligns content to the top */
}

.left-content {
    width: 75%; /* 3/4 of the container width */
    padding-right: 10px; /* Adjust as needed for spacing */
}

/* Right content (ads) */
.right-content {
    width: 25%; /* Adjust the width as needed */
    padding-left: 10px; /* Spacing from the left content */
    position: -webkit-sticky; /* For Safari */
    position: sticky;
    top: 0; /* Distance from the top of the viewport */
    align-self: flex-start; /* Aligns to the top of the flex container */
}

/************************************ Carousel container ************************************/
.carousel-container {
    overflow: hidden;
    position: relative;
    width: 100%;
    max-height: 500px; /* Set a max-height for your carousel images */
}

/* Carousel inner container */
.carousel-inner {
    display: flex;
    width: 100%;
    transition: transform 0.5s ease;
}

.carousel-inner img {
    cursor: pointer;
}

.carousel-item {
    min-width: 100%;
    transition: opacity 0.5s ease;
}

/************************************ 今日话题 bar ************************************/
/************************************ Main bar container ************************************/
.bar-container {
    position: relative; /* Allows absolute positioning inside */
    max-width: 900px; /* Adjust to match your design */
    margin: 40px auto; /* Center the container with some margin on the top and bottom */
    height: 50px; /* Height of the foreground bar */
    background: #000000; /* Black background */
    border-radius: 25px; /* Rounded corners for the container */
    overflow: hidden; /* Ensures that children do not overflow */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Foreground bar with gradient */
.bar-foreground {
    background: #000000; /* Black background */
    width: 100%; /* Full width */
    height: 100%; /* Full height to cover the container */
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center; /* Horizontally center children (text) */
    align-items: center; /* Vertically center children (text) */
}

/* Text inside the bar */
.bar-text {
    color: #FFFFFF; /* White text */
    font-family: Arial, sans-serif; /* Font family */
    font-size: 18px; /* Font size */
    /* No need to specify text-align as flexbox will center the text */
}

/************************************ Topics container ************************************/
.topics-container {
    display: flex;
    flex-direction: column;
    gap: 20px; /* Adds space between topics */
    margin-top: 50px; /* Space from the previous content */
}

.topic {
    display: flex;
    align-items: center;
    gap: 20px; /* Adds space between image and description */
}

.topic-image {
    width: 400px; /* Fixed width for the image */
    height: 200px; /* Fixed height for the image */
    object-fit: cover; /* Cover the container without stretching the image */
    flex-shrink: 0; /* Prevents the image from shrinking */
}

.description {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allows the description to take up remaining space */
    font-family: Arial, sans-serif; /* Font family */
}

.description h2 {
    margin: 0;
    font-size: 1.1em; /* Larger text for the title */
    color: black; /* Color of the title text */
}

.description h2:hover {
    color: rgba(0, 0, 0, 0.6); /* Black with reduced opacity for a lighter effect */
}

.description a {
    text-decoration: none;
}

.description p {
    margin: 0;
    font-size: 0.9em; /* Larger text for the title */
    color: black; /* Color of the description text */
}

.rectangle-border {
    display: inline-block; /* Shrink to fit content */
    width: 80px; /* Automatically size to content width */
    padding: 2px 5px; /* Adjust padding around the text */
    border: 2px solid #000000; /* Blue border, adjust thickness as needed */
    box-sizing: border-box; /* Include padding and border in the element's width */
    margin: 0; /* Remove default margin */
    margin-bottom: 5px;
}

.rectangle-border h2 {
    color: black; /* Blue text color to match the border */
    font-family: Arial, sans-serif; /* Your chosen font */
    font-size: 18px; /* Adjust the font size as needed */
    text-align: center; /* Center the text horizontally */
    margin: 0; /* Remove default margin from h2 */
}

/************************************ Advertisement Banner Container ************************************/
.ads-banner-container {
    width: 100%; /* Full width of the container */
    margin: 20px 0; /* Margin above and below the banner */
}

.ads-banner {
    width: 100%; /* Make the banner fill the container width */
    height: auto; /* Maintain aspect ratio */
    display: block; /* Removes any extra space at the bottom of the image */
}

/************************************ Right Hand Side Ads Container ************************************/
.ads-container {
    width: 100%; /* Full width of the right-content container */
    padding: 0; /* Adjust padding as needed */
}

.ad {
    width: 100%; /* Full width of the ads-container */
    margin-bottom: 20px; /* Space between ads */
}

/************************************ Bottom Ads Carousel Format ************************************/
.carousel-wrapper {
    max-width: 100%;
    overflow: hidden;
    background-color: #002A64; /* Dark blue background */
    margin: auto;
    margin-top: 20px;
}

.carousel-container2 {
    width: 100%;
    cursor: pointer;
}

.carousel-slide {
    display: flex;
    transition: transform 0.3s ease-in-out;
}

.carousel-item {
    flex: 0 0 100%; /* Each image takes up full width */
    max-height: 300px; /* Adjust height as needed */
    object-fit: contain; /* Ensures images fit without being cropped */
    margin: 0 auto; /* Centers the image */
}

/************************************ Latest Topic Need To View Format ************************************/
.flex-container {
    display: flex;
    justify-content: center; /* Centers flex items on the main axis */
    align-items: center; /* Centers flex items on the cross axis if needed */
    gap: 20px; /* Adjust the gap size as needed */
    padding: 20px;
    margin: 0 auto; /* Centers the container in the parent */
    width: 90%; /* Adjust the width as needed */
    max-width: 1200px; /* Maximum width of the container */
    box-sizing: border-box; /* Include padding and border in the width */
}

.flex-item {
    flex: 1; /* Each flex item will take up equal space */
    border: 1px solid #ccc; /* Border around the flex item if needed */
    padding: 10px;
    box-sizing: border-box;
    height: 400px; /* Fixed height for all flex items */
    background-color: #FFFFFF; /* Dark blue background */
}

.flex-item img {
    width: 100%; /* Image takes full width of the container */
    height: 160px; /* Fixed height */
    object-fit: cover; /* Ensures the image covers the area without stretching */
}

.flex-item .description {
    margin-top: 10px; /* Space between image and description */
}

.title-with-border {
    background: #000000; /* Black background */
    color: #ffffff; /* White text */
    font-weight: bold; /* Bold font weight */
    font-size: 18px; /* Adjust font size as needed */
    padding: 10px 5px; /* Adjust padding as needed */
    margin: -10px -15px 10px -15px; /* Extend outside the container bounds */
    text-align: center; /* Center text horizontally */
    border: 3px solid #000000; /* Dark blue border */
}

/************************************ Footer Styles ************************************/
.footer {
    padding: 100px; /* Adjust the padding as needed */
    color: #fff; /* Set the text color to white */
    background-color: #000000;
    text-align: center; /* Center the text inside the footer */
    font-size: 16px; /* Set the font size */
    /* Add more styling as per your requirement */
}

/************************************ Mobile View Styles ************************************/
@media only screen and (max-width: 768px) {
    /* Header adjustments */
    .header {
        justify-content: space-between; /* Maintains space between logo and translator */
        padding: 15px;
    }

    .logo {
        order: 0; /* Ensures logo stays on the left */
        margin: 0 auto; /* Center the logo */
        max-width: 150px; /* Slightly smaller logo for mobile */
    }

    /* Style adjustments for mobile view */
    .translate-container {
        order: 1; /* Places the translate container on the right */
        position: absolute; /* Absolute position */
        right: 25px; /* Positioned to the right */
        top: 1.1%; /* Aligns it vertically center */
        transform: translateY(-50%); /* Precise vertical center alignment */
    }

    .translate-icon {
        margin-right: 5px;
    }

    .language-dropdown {
        width: auto; /* Adjust width for mobile */
        font-size: 14px; /* Adjust font size for better readability on mobile */
    }

    /* Thick bar adjustments */
    .thick-bar {
        height: 40px; /* Match height with the topic bar */
        border-radius: 15px; /* Half of height for full radius */
    }
    
    .navbar .nav-links {
        align-items: center; /* Center links */
        gap: 20px; /* Reduce gap between links */
    }

    .navbar .nav-links li a {
        font-size: 14px; /* Adjust font size for smaller screens */
    }

    /* Carousel adjustments */
    .carousel-container, .carousel-container2 {
        overflow: hidden; /* Ensures that no horizontal scrollbar appears */
    }

    .carousel-slide {
        display: flex; /* Keep the flex display */
        flex-wrap: nowrap; /* Prevent wrapping of items */
        transition: transform 0.3s ease-in-out; /* Smooth transition for sliding effect */
    }

    .carousel-slide img {
        width: 100%; /* Each image takes up full width of the viewport */
        height: auto; /* Height is automatic to maintain aspect ratio */
        flex: 0 0 auto; /* Prevent flex items from growing or shrinking */
    }

    /* Adjustments for a single item in view */
    .carousel-wrapper, .carousel-container, .carousel-container2, .carousel-slide {
        width: 100%; /* Full width of the container */
    }

    /* Topic bar adjustments */
    .bar-container {
        height: 40px; /* Match height with the thick bar */
        border-radius: 15px; /* Smoothed corners */
        margin: 10px auto; /* Center it horizontally with margin */
        margin-bottom: -30px;
    }

    .bar-container, .bar-text, .rectangle-border h2, .description h2, .description p {
        text-align: center; /* Center all text for a consistent look */
    }

    .bar-text, .rectangle-border h2, .description h2, .description p {
        font-size: 14px; /* Standard font size for mobile readability */
    }

    /* Topic image and description adjustments */
    .topic {
        flex-direction: column; /* Stack image and description vertically */
        align-items: center; /* Center-align the items for a neater look */
    }

    .topic-image {
        width: 100%; /* Full width images */
        height: auto; /* Auto height to maintain aspect ratio */
    }

    .description {
        text-align: center; /* Center-align the text for mobile */
        padding: 0 10px; /* Padding on the sides for readability */
        margin-top: -10px;
    }

    /* Rectangle border adjustments */
    .rectangle-border {
        padding: 5px 10px; /* Adjust padding for mobile */
        border: 2px solid #002A64; /* Maintain border thickness */
        margin: 10px auto; /* Center horizontally */
        width: fit-content; /* Only be as wide as its content */
    }

    .rectangle-border h2 {
        font-size: 16px; /* Adjust font size for mobile */
    }

    /* Footer adjustments */
    .footer {
        padding: 80px 10px; /* Adjust padding for a snugger footer */
        font-size: 12px; /* Smaller font size for a less obtrusive footer */
    }

    /* Flex container adjustments */
    .flex-container {
        flex-direction: column; /* Stack flex items vertically on mobile */
        align-items: center; /* Center-align the flex items */
    }

    .flex-item {
        width: 100%; /* Full width for mobile */
    }

    /* Hide the right content ads and make left content take full width */
    .right-content {
        display: none;
    }

    .left-content {
        width: 100%;
    }

    /* Bottom Ads Carousel adjustments */
    .carousel-wrapper {
        padding: 5px 0; /* Adjust padding for mobile layout */
    }

    .carousel-container2 {
        /* Optionally adjust width or max-width for smaller screens */
    }

    .carousel-slide {
        /* Keep the transition effect consistent with the PC version */
    }

    .carousel-item {
        max-height: 200px; /* Smaller height for mobile screens */
        object-fit: contain; /* Ensures images are fully visible on mobile */
    }

    /* Adjustments for the description box to ensure it doesn't overflow the width */
    .description {
        text-align: center; /* Center the description text */
        padding: 0 5px; /* Add padding to ensure text doesn't touch the edges */
    }

    /* Adjustments to the title with border for mobile */
    .title-with-border {
        font-size: 16px; /* Smaller font size for mobile */
        padding: 10px; /* Sufficient padding to make the text legible */
        border: 3px solid #002A64; /* Dark blue border */
        width: auto; /* Auto width to fit content */
        margin: 10px auto; /* Center the title with auto margins */
    }
}

/* Adjustments for mobile view, especially for smaller devices like iPhone */
@media only screen and (max-width: 480px) {
    .translate-container {
        border-radius: 10px; /* More reduced rounded corners */
        padding: 2px 5px; /* Significantly reduced padding */
        margin-top: 18px;
    }
    
    .translate-icon {
        margin-right: 3px;
        font-size: 18px; /* Further smaller icon size */
    }
    
    .language-dropdown {
        padding: 2px 5px; /* Significantly reduced padding */
        font-size: 12px; /* Further smaller text for the dropdown */
        border-radius: 5px; /* Smaller border-radius for dropdown */
    }
}

/* Additional styles for smooth transitions and user view enhancements can be added as needed */