/* --- 1. CSS Custom Properties (Variables) --- */

:root {
    /* General Colors */
    --c-text-light: #ecf0f1;
    --c-hover-light: #fffbf8; /* Cream color */
    --c-general-placeholder-bg: #dddddd;

    /* Outlines for Focus States */
    --c-outline-focus-subtle: rgba(174, 127, 95, 0.5); /* A translucent version of sidebar-bg */
    --c-outline-focus-light: rgba(236, 240, 241, 0.7); /* A translucent version of text-light */
    --c-outline-focus-dark: rgba(68, 57, 55, 0.7); /* A translucent version of header-bg */

    /* Shadows */
    --c-general-shadow-light: rgba(0,0,0,0.1);
    --c-general-shadow-dark: rgba(0,0,0,0.2);

    /* Header & Navigation */
    --c-header-bg: #443937;
    --c-header-logo-bg: #443937;
    --c-header-logo-text: #ecf0f1;
    --c-header-nav-link-text: #ecf0f1;
    --c-header-nav-link-text-hover: var(--c-hover-light);
    --c-header-submenu-bg: #342d2c;
    --c-header-submenu-link-text: #ecf0f1;
    --c-header-submenu-link-bg-hover: var(--c-hover-light);
    --c-header-submenu-link-text-hover: #ecf0f1;
    --c-header-icon-color: var(--c-text-light);
    --c-header-icon-badge-bg: var(--c-accent-02);
    --c-header-icon-badge-text: var(--c-header-bg);
    --c-header-bg-transparent-15: rgba(68, 57, 55, 0.15); /* RGB of #443937 with 15% opacity */
    --c-banner-text-bg: rgba(255, 255, 255, 0.3); /* For page banner content background */


    /* Page & Layout */
    --c-page-bg: #fefaf6;
    --c-content-wrapper-bg: #fffbf8;
    --c-content-bg: #fbf5f1;
    --c-layout-border-separator: #eee;
    --c-layout-wrapper-shadow: rgba(0,0,0,0.1);
    --c-content-default-text: #333;
    --c-text-primary: #333; /* Used in banner content */

    /* New Accent Colors */
    --c-accent-01: #89a2cd; /* Example: A base accent color (e.g., your current sidebar-bg) */
    --c-accent-02:  #a5cded; /* Example: Another base accent color */
    --c-accent-03: #e9eff7; /* Example: A third base accent color, perhaps a lighter one */

    /* Sidebar */
    --c-sidebar-bg: var(--c-page-bg);
    --c-sidebar-profile-pic-border: #fffbf8;
    --c-sidebar-account-link-text: #fffbf8;
    --c-sidebar-heading-text: #fffbf8;
    --c-sidebar-nav-link-text: #fffbf8;
    --c-sidebar-nav-link-text-hover: var(--c-hover-light);
    --c-sidebar-energy-fill: var(--c-accent-01); /* Accent 01 */
    --c-sidebar-energy-bg: #e8e8e8; /* Dark grey color */
    --c-sidebar-icon: #fff; /* A medium grey that contrasts with both #555 and #fffbf8 */

    /* Hero Section */
    --c-hero-bg: #f6ede7;
    --c-hero-heading-text: #443937;
    --c-hero-paragraph-text: #666;
    --c-hero-image-placeholder-bg: #b0c4de;

    /* Info Section & Features */
    --c-info-section-heading-text: #443937;
    --c-info-section-paragraph-text: #666;
    --c-feature-item-bg: #e9eff7;
    --c-feature-item-heading-text: #443937;
    --c-feature-item-icon-placeholder-bg: #c9dff7;

    /* Content */
    --c-content-card-bg: var(--c-page-bg);
    --card-border-radius: 8px;

    /* INPUT */
    --c-input-bg: #e6e6e6;
    
    /* Footer */
    --c-footer-bg: var(--c-header-bg);
    --c-footer-text: var(--c-outline-focus-light);
}


/* --- 2. Base Styles (Reset, Body, Container) --- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*:focus {
    outline: none;
}

/* html, body {
    height: 100%;
    /* overflow: hidden;} */


html {
    height: 100%;
}

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* overflow: hidden;  */
    
    /* Keep your font, background, and color properties */
    font-family: 'Quicksand', sans-serif;
    line-height: 1.6;
    background-color: var(--c-page-bg);
    color: var(--c-content-default-text);
    background-image: url('../images/bg_active.webp');
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    background-position: center center;
}

/* REPLACEMENT for main.main-content-wrapper (around line 164) */
main.main-content-wrapper {
    width: 70vw;
    margin: 20px auto; /* Centers the whole layout */
    z-index: 5;
    display: grid;
    grid-template-columns: 11.25vw 25px 1fr; /* 1: Sidebar | 2: Gutter | 3: Content */
    align-items: flex-start; /* Aligns items to the top */
    flex-grow: 1; /* Fills vertical space */
    overflow: hidden; /* Contains children */
}

/* Full-width page wrapper (for pages without sidebar) */
.full-width-content-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.3);
    z-index: -1;
}

.container {
    max-width: 80%;
    margin: 0 auto;
    padding: 0 15px;
}


/* --- 3. Main Layout Structure --- */

/* Main Grid Wrapper */
.main-content-wrapper {
    padding: 20px 0;
    flex-grow: 1;
    overflow: hidden; /* Prevents margin collapse issues */
    z-index: 5;
}

/* Header */
.main-header {
    width: 100vw;
    height: 45px;
    background-color: var(--c-header-bg);
    color: var(--c-header-nav-link-text);
    position: sticky;
    top: 0;
    left: 0;
    z-index: 100;
    flex-shrink: 0;
}

.header-content-wrapper {
    width: 70vw;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}



/* Main Content Area */
.main-content {
  width: 100%;
  background-color: transparent;
  padding: 0 25px 15px;
  flex-grow: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.page-news-archive .main-content > * + * {
  margin-top: 20px;
}

/* Specifically remove the top margin from intro text when it follows a banner */
#page-banner + .intro-text-for-services {
  margin-top: 0;
}

#page-banner + * {
  margin-top: 0;
}

/* Footer */
footer {
    width: 100%;
    min-height: 40px;
    background-color: var(--c-footer-bg);
    color: var(--c-footer-text);
    text-align: center;
    padding: 10px 0;
    font-size: .9em;
    flex-shrink: 0;
}

footer .container {
    font-family: 'Quicksand', sans-serif;
}


/* --- 4. Component Styles --- */

/* --- Header Components --- */

.main-header .logo-area {
    width: 15%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--c-header-logo-bg);
    flex-shrink: 0;
}

.main-header .logo {
    font-family: 'Dancing Script', cursive;
    font-size: 1.75em;
    font-weight: 700;
    color: var(--c-header-logo-text);
    text-decoration: none;
}

.main-header .logo a {
  color: inherit;
  text-decoration: none;
}

.main-header .top-nav {
    flex-grow: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 35px;
}

.main-header .top-nav ul {
    list-style: none;
    display: flex;
    height: 100%;
}

.main-header .top-nav ul li,
.main-header .top-nav ul li ul li {
    position: relative;
    background-color: transparent;
}

.main-header .top-nav ul li {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 15px;
}

.main-header .top-nav ul li a {
    font-family: 'Quicksand', sans-serif;
    color: var(--c-header-nav-link-text);
    font-size: 0.85em;
    text-decoration: none;
    font-weight: bold;
    white-space: nowrap;
    letter-spacing: 0.05em;
    transition: color 0.2s ease;
}

.main-header .top-nav ul li a:focus-visible {
    outline: 1px solid var(--c-outline-focus-light);
    outline-offset: -1px;
    border-radius: 3px;
}

.main-header .top-nav ul li ul li a.disabled-link {
    color: #888 !important;
    cursor: not-allowed;
    opacity: 0.7;
    pointer-events: none;
    background-color: var(--c-header-submenu-bg) !important;
    outline: none;
}

.main-header .top-nav ul li ul,
.notification-item .account-submenu {
    display: none;
    position: absolute;
    background-color: var(--c-header-submenu-bg);
    list-style: none;
    min-width: 160px;
    z-index: 1000;
    box-shadow: 0px 8px 16px var(--c-general-shadow-dark);
    top: 100%;
    left: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    border-radius: 5px;
    
    /* --- Add these to ensure consistency --- */
    padding: 0;
    margin: 0;
}

/* --- Account Dropdown Centering Override --- */
.notification-item .account-submenu {
    left: 50%;
    transform: translateX(-50%);
}

.main-header .top-nav ul li ul li ul {
    top: 0;
    left: 100%;
}

.notification-item .account-submenu li,
.main-header .top-nav ul li ul li {
    padding: 0;
    height: auto;
    width: 100%;
}

.notification-item .account-submenu li a,
.main-header .top-nav ul li ul li a {
  font-family: 'Quicksand', sans-serif;
  color: var(--c-header-submenu-link-text);
  text-decoration: none;
  display: block;
  font-weight: normal;
  white-space: nowrap;
  padding: 8px 12px;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  background-color: var(--c-header-submenu-bg);
  font-size: 0.85rem; /* This was changed from 'em' to 'rem' */
  transition: background-color 0.2s ease, color 0.2s ease;
}

.main-header .top-nav ul li ul li a:focus-visible {
    outline: 1px solid var(--c-outline-focus-light);
    outline-offset: -1px;
    border-radius: 3px;
}

.main-header .top-nav ul li:hover > ul,
.main-header .top-nav ul li:focus-within > ul,
.notification-item.has-dropdown:hover .account-submenu,
.notification-item.has-dropdown:focus-within .account-submenu {
  display: block;
  opacity: 1;
  visibility: visible;
}

.main-header .top-nav ul li ul li:hover > ul,
.main-header .top-nav ul li ul li:focus-within > ul {
    display: block;
    opacity: 1;
    visibility: visible;
}

.header-notification-icons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 15px;
    height: 100%; /* Ensures this container fills the header height */
}

.header-notification-icons .notification-item {
    position: relative;
    color: var(--c-header-icon-color);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 3px; /* Changed padding to horizontal only */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    height: 100%; /* Makes the icon container 45px tall */
}

.header-notification-icons .notification-item:focus-visible {
    outline: 1px solid var(--c-outline-focus-light);
    outline-offset: 1px;
    border-radius: 50%;
}

/* Target the anchor link inside the header notification icons */
.header-notification-icons a.notification-item {
    text-decoration: none;
    /* Also ensure the icon color remains correct */
    color: inherit; 
}

/* --- Account Dropdown Centering Override --- */
.notification-item .account-submenu {
  left: 50%;
  transform: translateX(-50%);
}

.header-notification-icons .notification-item .notification-count {
    font-family: 'Quicksand', sans-serif;
    position: absolute;
    top: 5px;
    right: -4px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 15px;
    height: 15px;
    padding: 1px;
    border-radius: 50%;
    background-color: var(--c-header-icon-badge-bg);
    color: var(--c-header-icon-badge-text);
    font-size: 0.6em;
    font-weight: bold;
    white-space: nowrap;
    border: 1px solid var(--c-header-bg);
    box-sizing: border-box;
    line-height: 1;
}

.header-notification-icons .notification-item .notification-count:empty {
    display: none;
}

.header-notification-icons .search-icon-link {
    color: var(--c-header-icon-color);
    font-size: 1.1rem;
    padding: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 50%;
    transition: color 0.2s ease;
}

.header-notification-icons .search-icon-link:focus-visible {
    outline: 1px solid var(--c-outline-focus-light);
    outline-offset: 1px;
    border-radius: 50%;
}


.header-right-side {
  display: flex;
  align-items: center;
  gap: 10px; /* This will space out the icon group from the mobile menu */
}



/* INDEX PAGE LOGIN FORM */

#auth-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 70vh; /* Adjust as needed */
}

.auth-container {
    max-width: 450px;
    width: 90%;
    margin: 20px auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9); /* Semi-transparent white */
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

    .auth-tabs {
        display: flex;
        border-bottom: 1px solid #ddd;
        margin-bottom: 1.5rem;
    }
    .auth-tab {
        padding: 0.8rem 1.2rem;
        cursor: pointer;
        border: none;
        background: transparent;
        font-size: .9rem;
        font-weight: bold;
        color: #888;
    }
    .auth-tab.active {
        color: #333;
        border-bottom: 3px solid #778961;
    }
    .auth-form {
        display: none;
    }
    .auth-form.active {
        display: block;
    }
    .form-group {
        margin-bottom: 1rem;
    }
    .form-group label {
      font-size: .9rem;
        display: block;
        margin-bottom: 0.5rem;
        font-weight: bold;
    }
    .form-group input {
        width: 100%;
        padding: 0.8rem;
        border: 1px solid #ccc;
        border-radius: 4px;
        box-sizing: border-box;
    }
    .auth-button {
        width: 100%;
        padding: 1rem;
        background-color: #778961;
        color: white;
        border: none;
        border-radius: 4px;
        font-size: .9rem;
        font-weight: bold;
        cursor: pointer;
        margin-top: 1rem;
    }
    .auth-button:hover {
        background-color: #667851;
    }
    #auth-message {
        margin-top: .8rem;
        text-align: center;
        font-weight: bold;
    }

    /* --- Login Page Layout Fix --- */

/* When the logged-out class is active, hide the sidebar */
body.logged-out-view .left-column-wrapper {
    display: none;
}

/* Make the main grid container use only one column */
body.logged-out-view .main-content-wrapper {
    grid-template-columns: 1fr;
    width: 90vw; /* You can adjust this width */
}

body.logged-out-view .main-content-header-title {
    display: none;
}

/* Make the content card (which holds the login) use that column */
body.logged-out-view .main-content-card {
  grid-column: 1;

    /* ADD THESE LINES to hide the card's appearance */
  background-color: transparent;
  border: none;
  box-shadow: none;
}




/* SIDEBAR STYLES */

/* This is in your style.css (around line 207) */
.left-column-wrapper {
  display: flex;
  flex-direction: column;
  gap: 15px;
  flex-shrink: 0;
  width: 11.25vw;
  grid-column: 1; /* Puts this in the 1st grid column */
  height: 100%;
}



/* ============================================
   MOBILE MENU STYLES - Sliding Submenu from Right
   ============================================ */

/* Mobile menu toggle button & mobile-only elements - HIDDEN on desktop */
.mobile-menu-toggle,
.mobile-only {
 display: none !important;
}

/* But show mobile-only items within header-notification-icons when on mobile */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block !important;
  }
  
  .header-notification-icons .notification-item.mobile-only {
    display: flex !important;
  }
}

/* Main mobile navigation panel - slides from RIGHT */
.mobile-nav-panel {
  position: fixed;
  top: 50px;
  right: -50vw; /* Start off-screen to the right */
  width: 50vw;
  height: calc(100vh - 50px);
  background: #342d2c;
  z-index: 99;
  padding: 20px;
  overflow-y: auto;
  transition: right 0.3s ease-in-out;
  /* box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3); */
}

/* When menu is open, slide it into view from the right */
.mobile-nav-panel.is-open {
  right: 0;
}

/* Submenu panel - slides from RIGHT, overlapping main menu */
.mobile-submenu-panel {
  position: fixed;
  top: 50px;
  right: -50vw; /* Start off-screen to the right */
  width: 50vw;
  height: calc(100vh - 50px);
  background: #2a2423;
  z-index: 100; /* Higher than main menu */
  padding: 20px;
  overflow-y: auto;
  transition: right 0.3s ease-in-out;
  /* box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3); */
}

/* When submenu is open, slide it into view from the right */
.mobile-submenu-panel.is-open {
  right: 0;
}

/* Back button for submenu */
.submenu-back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--c-text-light);
  font-size: 0.9rem;
  font-weight: bold;
  padding: 10px 0;
  margin-bottom: 15px;
  cursor: pointer;
  font-family: 'Quicksand', sans-serif;
}

.submenu-back-btn:hover {
  color: var(--c-hover-light);
}

/* Submenu title */
.mobile-submenu-title {
  color: var(--c-text-light);
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Navigation container inside mobile panel */
.mobile-nav-panel .top-nav {
  padding-left: 0;
  margin-top: 0;
}

/* Stack menu items vertically */
.mobile-nav-panel .top-nav ul {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: 100%;
  height: auto;
}

.mobile-nav-panel .top-nav ul li {
  width: 100%;
  padding: 0;
  height: auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}


/* Main menu links */
.mobile-nav-panel .top-nav ul li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 10px;
  color: var(--c-text-light);
  text-decoration: none;
  font-weight: bold;
  font-size: 0.95rem;
  transition: background-color 0.2s ease;
}

.mobile-nav-panel .top-nav ul li a:hover {
  background-color: var(--c-header-bg);
}

/* Arrow indicator for items with submenus */
.mobile-nav-panel .top-nav ul li.has-submenu > a::after {
  content: '›';
  font-size: 1.5rem;
  font-weight: normal;
  opacity: 0.6;
}

/* Hide desktop submenus in mobile panel */
.mobile-nav-panel .submenu {
  display: none !important;
}

/* Submenu links styling */
.mobile-submenu-panel ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-submenu-panel ul li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-submenu-panel ul li a {
  display: block;
  padding: 15px 10px;
  color: #ccc;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.mobile-submenu-panel ul li a:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--c-hover-light);
}

/* Hide disabled links in submenu */
.mobile-submenu-panel ul li:has(a.disabled-link) {
  display: none;
}

/* Overlay to darken background when menu is open */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 45px;
  left: 0;
  width: 100%;
  height: calc(100vh - 45px);
  background: rgba(0, 0, 0, 0.5);
  z-index: 97;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.mobile-menu-overlay.is-visible {
  display: block;
  opacity: 1;
}

/* Mobile status bar */
.mobile-status-bar {
  display: none; /* Hidden by default on desktop */
}

/* Only show mobile menu elements on mobile screens */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
    background-color: transparent;
    border: none;
    color: var(--c-header-icon-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
  }
  

}






/* --- Card Components --- */

.sidebar-card {
    background-color: var(--c-sidebar-bg);
    border-radius: 10px;
    box-shadow: 0 5px 15px var(--c-general-shadow-light);
    padding: 0 15px 20px 15px;
}

/* .main-content-card {
    background-color: var(--c-content-card-bg);
    border-radius: 10px;
    box-shadow: 0 5px 15px var(--c-general-shadow-light);
    display: flex;
    flex-direction: column;
    width: 53vw;
    margin: 0 auto;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;} */

/* This is in your style.css (around line 608) */
.main-content-card {
  background-color: var(--c-content-card-bg);
  border-radius: 10px;
  box-shadow: 0 5px 15px var(--c-general-shadow-light);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  align-self: stretch;
  grid-column: 3; /* Puts this in the 3rd grid column */
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
    /* The fixed width and auto margin have been removed */
}

.card-title-base {
    background-color: var(--c-header-bg);
    padding: 0;
    border-bottom: 1px solid var(--c-layout-border-separator);
    font-family: 'Quicksand', sans-serif;
    font-size: .9rem;
    color: var(--c-content-bg);
    flex-shrink: 0;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.main-content-header-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 25px 3px 25px;
}

.main-content-header-title .header-sub-category {
    font-weight: 600;
}

.sidebar-card-title {
    display: flex;
    align-items: center;
    padding: 5px 25px 3px 25px;
    margin-left: -15px;
    margin-right: -15px;
    width: calc(100% + 15px + 15px);
    box-sizing: border-box;
}

.sidebar-card-title .header-text-group {
    flex-grow: 1;
    text-align: center;
    font-weight: 600;
}

/* --- Sidebar Components --- */

.sidebar {
    width: 100%;
    background-color: transparent;
    padding: 0;
    border-right: none;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    text-align: center;
    gap: 20px;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar .profile-pic-placeholder {
    width: 75%;
    height: auto;
    aspect-ratio: 1 / 1;
    background-color: var(--c-general-placeholder-bg);
    border-radius: 50%;
    margin: 20px auto 5px;
    border: 3px solid var(--c-sidebar-profile-pic-border);
    box-sizing: border-box;
}

.game-bars-wrapper {
    /* Kept as a placeholder, although empty in original. */
}

.energy-bar-container,
.currency-bar-container,
.premium-currency-bar-container {
    width: 90%;
    height: 18px;
    border-radius: 10px;
    margin: 5px auto 10px;
    overflow: hidden;
    position: relative;
}

.energy-bar-container {
    background-color: var(--c-sidebar-energy-bg);
}
.currency-bar-container,
.premium-currency-bar-container {
    background-color: var(--c-sidebar-energy-fill);
}

.currency-icon,
.premium-currency-icon {
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7em;
    color: var( --c-sidebar-icon);
    line-height: 1;
    white-space: nowrap;
    z-index: 2;
}

.currency-amount,
.premium-currency-amount {
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7em;
    font-weight: bold;
    color: var( --c-sidebar-icon);
    line-height: 1;
    white-space: nowrap;
    z-index: 1;
}

.energy-bar-fill {
    height: 100%;
    transition: width 0.3s ease-in-out;
    border-radius: 7.5px;
    background-color: var(--c-sidebar-energy-fill);
    position: relative;
    overflow: hidden;
}

.energy-icon {
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7em;
    color: var( --c-sidebar-icon);
    line-height: 1;
    white-space: nowrap;
    z-index: 2;
}

.energy-percentage {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var( --c-sidebar-icon);
    font-size: 0.7em;
    font-weight: bold;
    z-index: 1;
    line-height: 1;
    white-space: nowrap;
    transition: left 0.3s ease, right 0.3s ease, transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    right: 5px;
}

.energy-percentage--centered {
    right: 7px;
}

.energy-percentage--hidden {
    opacity: 0;
    visibility: hidden;
}

.current-time-display {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.75em;
    font-weight: bold;
    color: var(--c-content-default-text);
    text-align: center;
    margin-top: 0;
    padding-top: 0;
}



/* --- Button Components --- */

.close-content-card-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 1.1em;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
    transition: color 0.2s ease;
}

.close-content-card-btn {
    font-size: 1.5em;
    padding: 0;
}

.close-notification:hover,
.close-content-card-btn:hover {
    color: #555;
}

.close-notification:focus-visible,
.close-content-card-btn:focus-visible {
    outline: 1px solid var(--c-outline-focus-subtle);
    outline-offset: 2px;
    border-radius: 3px;
}

.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
    color: white;
}

.btn-primary {
    background-color: var(--c-sidebar-bg);
}

.btn-primary:hover {
    background-color: #926a4e;
    transform: translateY(-2px);
}

.btn-primary:focus-visible {
    outline: 2px solid var(--c-outline-focus-light);
    outline-offset: 3px;
    border-radius: 5px;
}

.btn-secondary {
    background-color: #6a6a6a;
    color: var(--c-text-light);
}

.btn-secondary:hover {
    background-color: #555;
    transform: translateY(-2px);
}

.btn-secondary:focus-visible {
    outline: 2px solid var(--c-outline-focus-light);
    outline-offset: 3px;
    border-radius: 5px;
}

.btn-tertiary {
    background-color: transparent;
    color: var(--c-info-section-heading-text);
    border: 2px solid var(--c-info-section-heading-text);
    padding: 8px 20px;
    margin-top: 20px;
}

.btn-tertiary:hover {
    background-color: var(--c-info-section-heading-text);
    color: var(--c-text-light);
    transform: translateY(-2px);
}

.btn-tertiary:focus-visible {
    outline: 2px solid var(--c-outline-focus-dark);
    outline-offset: 3px;
    border-radius: 5px;
}


/* --- 5. Page-Specific Styles (for Welcome Page) --- */

/* Hero Section */
#hero {
    background-color: var(--c-hero-bg);
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 25px;
    border-radius: 4px;
}

#hero h2 {
    font-family: 'Libre Baskerville', serif;
    font-size: 2.2rem;
    color: var(--c-hero-heading-text);
    margin-bottom: 8px;
}

#hero p {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.1rem;
    color: var(--c-hero-paragraph-text);
    margin-bottom: 15px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-image-placeholder {
    width: 100%;
    max-width: 600px;
    height: 200px;
    background-color: var(--c-hero-image-placeholder-bg);
    margin: 15px auto 0;
    border-radius: 6px;
    object-fit: cover;
    height: auto;
    max-height: 300px;
}

.hero-cta-buttons {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Info Section & Features Grid */
.info-section {
    padding: 20px 0;
}

.info-section h3 {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.5rem;
    color: var(--c-info-section-heading-text);
    margin-bottom: 15px;
    text-align: center;
}

.info-section > p {
    font-family: 'Quicksand', sans-serif;
    text-align: center;
    margin-bottom: 30px;
    color: var(--c-info-section-paragraph-text);
    font-size: 0.95rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.features-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
}

.feature-item {
    flex-basis: calc(33.333% - 20px);
    min-width: 250px;
    background-color: var(--c-feature-item-bg);
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    box-shadow: 0 2px 5px var(--c-general-shadow-light);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.feature-item h4 {
    font-family: 'Josefin Sans', sans-serif;
    color: var(--c-feature-item-heading-text);
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.feature-item p {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.95rem;
    color: var(--c-info-section-paragraph-text);
    flex-grow: 1;
    margin-bottom: 10px;
}

.feature-icon-placeholder {
    width: 70px;
    height: 70px;
    background-color: var(--c-feature-item-icon-placeholder-bg);
    border-radius: 50%;
    margin: 10px auto 0;
    flex-shrink: 0;
}

/* Latest News Section */

.news-feed {
  display: flex;
  flex-direction: column;
}

.news-item {
  position: relative;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  padding: 24px;
  margin-bottom: 20px;
  transition: background-color 0.3s ease;
}

.news-item:hover {
  background-color: var(--c-hero-bg);
}

.news-item:hover .post-badge {
  background-color: #fff;
  color: #333; /* We also change the text to a dark color for readability */
}

.news-item p strong {
  font-size: 0.85rem; 
}

.post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.post-badge {
  display: inline-block;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 4px;
  margin-right: 10px;
}

.post-badge.devlog {
  background-color: #E6F2FF;
  color: #0066CC;
}

.post-badge.news {
  background-color: #F6EFFF;
  color: #8A3FFC;
}

.post-body {
  max-height: 75px; /* Adjust this to show more/less text when collapsed */
  overflow: hidden;
  transition: max-height 0.4s ease-in-out;
}

/* When a post has this class, its body will expand */
.news-item.is-expanded .post-body {
  max-height: 5000px; /* A large number to ensure all content fits */
}

/* Make the header look clickable */
.post-header-clickable {
  cursor: pointer;
}

/* Styles for news page filter tags */

.news-filter-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  margin-bottom: 10px;
}

.filter-button {
  background-color: #fff;
  border: 1px solid var(--c-layout-border-separator);
  border-radius: 12px;
  padding: 5px 15px;
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-button:hover {
  background-color: #f0f0f0;
  border-color: #ccc;
}

/* Style for the currently selected filter */
.filter-button.active {
  background-color: var(--c-header-bg); /* Your dark header color */
  color: #fff;
  border-color: var(--c-header-bg);
}

/* End Styles for news page filter tags */

.news-item h4 {
  font-family: 'Libre Baskerville', serif;
  font-size: 1rem;
  margin: 0;
  color: #222;
}

.news-item h5 {
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 20px 0 5px 0;
}

.news-date {
  font-size: 0.75rem;
  color: #777;
  font-style: italic;
  margin: 4px 0 12px 0;
}

.news-item p {
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0 0 10px 0;
}

.news-author {
  font-size: 0.85rem;
  color: #666;
  margin-top: 12px;
  padding-left: 50px;
  font-style: italic;
}

.news-item ul {
  padding-left: 50px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.card-link-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* This makes the link cover the entire card area */
}



/* --- Horse Table Styling --- */

.table-container {
    margin: 20px 0;
    overflow-x: auto; /* Ensures table is scrollable on very small screens if needed */
}

.horse-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

/* --- Table Header --- */
.horse-table thead {
    background-color: var(--c-header-bg-transparent-15); /* A light version of your header */
}

.horse-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: bold;
    color: var(--c-header-bg);
    border-bottom: 2px solid var(--c-header-bg);
}

/* --- Table Body & Cells --- */
.horse-table tbody tr {
    border-bottom: 1px solid var(--c-layout-border-separator);
    transition: background-color 0.2s ease;
}

.horse-table tbody tr:last-of-type {
    border-bottom: none;
}

.horse-table tbody tr:hover {
    background-color: var(--c-feature-item-bg); /* A subtle hover effect */
}

.horse-table td {
    padding: 12px 15px;
    vertical-align: middle;
}

/* --- Specific Column Styling --- */
.horse-name-link {
    font-weight: bold;
    color: var(--c-header-bg);
    text-decoration: none;
    display: block; /* Makes the whole area clickable */
}
.horse-name-link:hover {
    text-decoration: underline;
}

.barn-name {
    display: block;
    font-size: 0.9em;
    color: #777;
    font-style: italic;
    margin-top: 2px;
}

/* --- Responsive View for Mobile --- */
@media (max-width: 768px) {
    /* Hide the original table header */
    .horse-table thead {
        display: none;
    }

    /* Make each table row a card */
    .horse-table tr {
        display: block;
        border: 1px solid var(--c-layout-border-separator);
        border-radius: var(--card-border-radius);
        margin-bottom: 15px;
        box-shadow: var(--c-general-shadow-light);
        background-color: #fff;
    }
    
    .horse-table tbody tr:hover {
        background-color: #fff; /* Disable row hover, card is enough */
    }

    /* Stack cells vertically */
    .horse-table td {
        display: block;
        text-align: right; /* Align content to the right */
        padding: 10px;
        padding-left: 50%; /* Make space for the label */
        position: relative;
        border-bottom: 1px dotted var(--c-layout-border-separator);
    }
    
    .horse-table td:last-child {
        border-bottom: none;
    }

    /* Use the data-label for the header text */
    .horse-table td::before {
        content: attr(data-label); /* Use the data from the 'data-label' attribute */
        position: absolute;
        left: 10px;
        width: calc(50% - 20px);
        text-align: left;
        font-weight: bold;
        color: var(--c-header-bg);
    }
}



























/* --- 6. Media Queries for Responsiveness --- */

/* For Tablets and Smaller Laptops */
@media (max-width: 1024px) {
  .main-content-wrapper,
  .header-content-wrapper {
    width: 90vw;
  }

  .main-header .top-nav ul li {
    padding: 0 10px;
  }

  /* Make features stack 2x2 instead of 3 in a row */
  .feature-item {
    flex-basis: calc(50% - 20px);
  }
}


/* For Mobile Phones and Portrait Tablets */
@media (max-width: 640px) {

  .main-container {
        padding: 0px 10px;
    }

  /* --- MAIN LAYOUT --- */
  /* Use the more specific selector to override */
  main.main-content-wrapper {
    display: block !important; /* Override the grid */
    width: 100% !important;
    height: auto;
    margin: 0;
    padding: 0;
    grid-template-columns: none;
  }

  /* --- HIDE DESKTOP & SHOW MOBILE ELEMENTS --- */
.main-header .top-nav,
 .left-column-wrapper,
 .main-content-header-title {
  display: none !important;
 }

 .show-on-mobile {
  display: flex !important;
}

 .hide-on-mobile {
  display: none !important;
 }

 .mobile-only {
  display: flex !important; /* Show on mobile */
 }

/* Mobile menu toggle button & mobile-only elements - HIDDEN on desktop */
.mobile-menu-toggle,
.header-notification-icons .notification-item.mobile-only {
 display: none;
}

  .mobile-status-bar {
    display: none !important;
  }

  /* Make content card full width */
  .main-content-card {
    width: 100% !important;
    max-width: none;
    border-radius: 0;
    box-shadow: none;
    grid-column: auto;
    margin: 0;
  }
  
  .main-content {
    padding: 15px;
    width: 100%;
  }

  /* --- HEADER & STATUS BAR --- */
  .main-header {
    height: auto;
    padding: 0;
    width: 100vw;
  }
  
  .header-content-wrapper {
    width: 100%;
    padding: 0 2.5vw;
    justify-content: space-between;
  }
  
  .main-header .logo-area {
    width: auto;
    flex-grow: 0;
  }

  /* Hide page banners on mobile */
  #page-banner {
    display: none;
  }

  /* DON'T override body/html width - let full-width pages work normally */
  /* Remove or comment out these lines:
  body, html {
    width: 100%;
    overflow-x: hidden;
  }
  */
}