/*************************/
/* HIGHLIGHT BOX */

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Leaderboard Section Mobile Padding Override */
@media (max-width: 800px) {
  /* Reduce top padding to bring header closer to box top on mobile */
  #leaderboard.highlightBox {
    padding-top: 10px;
    padding-bottom: 20px;
  }
}


/* Overlay text on image */
.highlight-image-overlay {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 0.9em;
    max-width: 80%;
}

/* Leaderboard Header */
.leaderboard-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 20px;
}

/* Leaderboard Title and Dropdown */
#leaderboard-title {
    font-size: 2em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
}

/* Select Wrapper */
.select-wrapper {
    position: relative;
    display: inline-block;
}

/* Leaderboard Select Dropdown Styling using inputField class */
#leaderboard-category.inputField {
    width: 120px;
    padding: 8px 30px 8px 8px; 
    font-size: 1em;
    border: none;
    border-bottom: 2px solid #66bb6a;
    background-color: transparent;
    color: #333;
    cursor: pointer;
    font-family: "Kanit", sans-serif;
    font-weight: 400;
    text-align: left;
}

/* Visually Hidden Label for Accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/*************************/
/* ABOUT SECTION INSIDE HIGHLIGHT BOX */

/* Override styles for highlightBox when used as About section */
.highlightBox.about-section .highlight-content {
    /* Ensure that even without image, content is properly aligned */
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.highlightBox.about-section .highlight-text h2 {
    /* Customize heading style for About section */
    font-size: 2em;
    margin-bottom: 15px;
    text-align: left;
}

.highlightBox.about-section .highlight-text p {
    /* Customize paragraph style for About section */
    font-size: 1.1em;
    color: #444;
    line-height: 1.6;
}

/* Responsive Styling for About Section */
@media (max-width: 800px) {
    .highlightBox.about-section {
        padding: 30px 15px; 
    }

    .highlightBox.about-section .highlight-text h2 {
        font-size: 1.5em;
    }

    .highlightBox.about-section .highlight-text p {
        font-size: 1em;
    }
}

/*************************/
/* RECENT BATTERY DATA SECTION */

#recentBatteryData {
    margin-bottom: 20px;
}

#recentBatteryData h2 {
    color: #e8491d;
    margin-bottom: 20px;
    font-size: 2em;
    text-align: left;
    border-bottom: 2px solid #e8491d;
    padding-bottom: 10px;
}

.battery-data-container {
    display: flex;
    flex-direction: column;
}

/* Battery Item */
.battery-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    background-color: #ffffff;
    padding: 15px 0;
}

/* Add border-bottom to all but the last item */
.battery-data-container > .battery-item:not(:last-child) {
    border-bottom: 2px solid #e8491d;
    margin-bottom: 10px;
}

.battery-item img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 0;
    /* add space between text and image */
    margin-left: 20px;
}

.battery-item .battery-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.battery-item .battery-info .battery-title-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

.battery-item .battery-info h3.battery-name {
    color: #e8491d;
    margin: 0;
    font-size: 1.5em;
}

.battery-item .battery-info .battery-type {
    color: #555;
    font-size: 0.95em;
    margin-left: 5px;
}

.battery-item .battery-info p {
    color: #444;
    margin: 10px 0 15px 0;
    line-height: 1.5;
}

/*************************/
/* RECENT ARTICLES SECTION */

#recentArticles {
    margin-bottom: 20px;
}

#recentArticles h2 {
    color: #e8491d;
    margin-bottom: 20px;
    font-size: 2em;
    text-align: left;
    border-bottom: 2px solid #e8491d;
    padding-bottom: 10px;
}

.articles-container {
    display: flex;
    flex-direction: column;
}

/* Article Item */
.article-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 15px 0;
}

/* Add border-bottom to all but the last item */
.articles-container > .article-item:not(:last-child) {
    border-bottom: 2px solid #e8491d;
    margin-bottom: 10px;
}

.article-item img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 0;
    /* add space between text and image */
    margin-left: 20px;
}

.article-item .article-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.article-item .article-info h3 {
    color: #e8491d;
    margin: 0;
    font-size: 1.5em;
}

.article-item .article-info p {
    color: #444;
    /* match spacing with Recent Battery Data descriptions */
    margin: 10px 0 15px;
    line-height: 1.5;
}

/*************************/
/* BUTTON STYLES */

.battery-data-container > .battery-item:not(:last-child) {
    border-bottom: 2px solid #e8491d;
    margin-bottom: 10px;
}

/*************************/
/* BATTERY TYPE TEXT */

.battery-title-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Mobile: stack image below text in Recent Battery & Articles sections */
@media (max-width: 600px) {
  .battery-item,
  .article-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .battery-item img,
  .article-item img {
    margin: 15px 0 0 0;
    width: 100%;
    max-width: 150px;
    height: auto;
    max-height: 150px;
  }

  .battery-item .battery-info,
  .article-item .article-info {
    width: 100%;
  }
}

.battery-type {
    color: #555;
    font-size: 0.95em;
    margin-left: 5px;
}
