/* ============================================
   HORSE GAME - STANDARDIZED COMPONENT LIBRARY
   ============================================ */

/* --- ROOT VARIABLES --- */
:root {
    --c-accent-01: #89a2cd;
    --c-accent-01d: #5d7194;
    
    --primary-color: #8b7aa8;
    --primary-light: #a693bb;
    --accent-color: #c9a5b8;
    --accent-light: #dbbfce;

    /* Other Colours */

    --hurt-color: #e68885;
    --hurt-color-d: #d4716d;

    /* MORE ACCENTS */

    --go-green: #819a77;
    --go-yellow: #d9b76a;
    --mid-grey: #d1d4d4;
    
    
    /* Muted stat colors */
    --health-color: #d4918f;
    --energy-color: #d9b76a;
    --mood-color: #7ba8c4;
    --bond-color: #c9a5b8;
    --wildness-color: #cd9d70;
    --stress-color: #9b8aad;
    --pregnancy-color: #7eb894;
    
    /* Professional neutrals */
    --bg-main: #fafafa;
    --bg-card: #ffffff;
    --bg-hover: #f8f8f8;
    --border-color: #e5e5e5;
    --border-light: #efefef;
    --text-primary: #2d2d2d;
    --text-secondary: #737373;
    --text-muted: #a3a3a3;
    
    /* Subtle shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.08);

    --conformation-perfect: #8b7aa8;
    --conformation-excellent: #7eb894;
    --conformation-good: #7ba8c4;
    --conformation-average: #d9b76a;
    --conformation-poor: #d4918f;
    
    --success-color: #7eb894;
}


/* --- MAIN UI COMPONENTS --- */

/* Fixes the underline on header icons */
#header-notification-bell {
  text-decoration: none;
  color: inherit; 
}


/* --- Notification Components --- */


#notification-list-container {
  display: flex;
  flex-direction: column;
  padding: 8px; /* Give 8px of space for shadows */
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

.notification-item-box p {
    flex-grow: 1;
    text-align: left;
    font-size: 0.8em;
    line-height: 1.4;
    color: var(--text-secondary) ; 
    text-justify: center;
}

.notification-item-box {
    background-color: hsl(from var(--c-page-bg) h s l / 0.9);
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(38, 38, 39, 0.4);
    padding: 10px 10px;
    
    /* --- ADD THIS --- */
    margin-left: -8px;  /* Break out of left padding */
    margin-right: -8px; /* Break out of right padding */
    margin-bottom: 8px; /* This replaces the 'gap' */
    /* --- END ADD --- */

    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer; 
    overflow: hidden;
    /* transition: opacity 0.3s ease, transform 0.3s ease;  */
    transition: opacity 0.3s ease, 
                transform 0.3s ease, 
                height 0.3s ease 0.1s,        /* Animate height */
                padding-top 0.3s ease 0.1s,   /* Animate padding */
                padding-bottom 0.3s ease 0.1s, /* Animate padding */
                margin-bottom 0.3s ease 0.1s;  /* Animate margin */
}

/* Removes the extra margin from the very last bubble */
.notification-item-box:last-child {
  margin-bottom: 0;
}

.notification-item-box.notification-type-info {

}

.notification-item-box.notification-type-success {
  
}

.notification-item-box.notification-type-warning {
    background: linear-gradient(
    to right, 
    hsl(from var(--hurt-color) h s l / 0.9), 
    hsl(from var(--hurt-color-d) h s l / 0.9)
    );
}


/* For 'special' event notifications */

.notification-item-box.notification-type-special {
    background: linear-gradient(
    to right, 
    hsl(from var(--primary-color) h s l / 0.9), 
    hsl(from var(--c-accent-01) h s l / 0.9)
    );
}


/* Optional: Make the text inside bold */
.notification-item-box.notification-type-warning p {
    color: white ; 
    font-weight: 500; 
}

/* Optional: Make the text inside bold */
.notification-item-box.notification-type-special p {
    color: white ; 
    font-weight: 500; 
}

.notification-item-box.is-dismissed {
  opacity: 0;
  transform: translateX(20px);
  
  /* ADD THESE to collapse the element */
  height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: 0;
}


/* --- Toast Notification Container --- */
/* --- Toast Notification Container --- */
/* This container lives in the top-right corner */
#toast-notification-container {
  position: fixed;
  /* Center horizontally */
  left: 50%;
  transform: translateX(-50%);
  /* Position near the top */
  top: 24px; 
  z-index: 2000; /* Ensure it's above all other content */
  
  /* Stack multiple toasts vertically */
  display: flex;
  flex-direction: column;
  gap: 12px; /* Spacing between toasts */
  
  /* Center the toasts within the container */
  align-items: center; 
  
  /* IMPORTANT: Prevents the container from blocking clicks on the page */
  pointer-events: none;
}

/* * This class is added to a notification to make it a toast.
 * It will automatically use all your .notification-item-box styles.
 * All we add is the animation.
*/
.toast-notification {
  /* Re-enable clicks for the toast itself */
  pointer-events: auto; 
  
  /* Add some modern styling */
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  
  /* Set a reasonable size */
  width: auto; /* Let it size to its content */
  min-width: 300px; /* But not too narrow */
  max-width: 90vw; /* And not too wide */
  
  /* .notification-item-box styles will apply for padding/colors */
}

/* Animation for the toast appearing */
@keyframes toast-fade-in {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============================================
   1.1 CIRCLE TAB NAVIGATION BUTTONS
   ============================================ */

.tab-circle-container {
 display: flex;
 justify-content: center;
 flex-wrap: wrap; /* <-- ADD THIS */
 gap: 10px;
 margin-top: 10px;
 margin-bottom: 20px;
}

.tab-circle-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.tab-circle-btn:hover {
    background-color: var(--bg-hover);
    transform: translateY(-2px);
}

.tab-circle-btn.active {
    background-color: var(--c-accent-01);
    color: white;
    border-color: var(--c-accent-01);
    box-shadow: 0 2px 8px rgba(139, 122, 168, 0.3);
}

.tab-circle-btn i {
    pointer-events: none;
}


/* ============================================
   1.2. TABS AS TEXT (Navigation Button Alternatives)
   ============================================ */

.game-tab-bar {
    display: flex;
    gap: 8px;
    /* border-bottom: 1px solid var(--border-light); */
    border-bottom: 2px solid var(--border-light);
}

.game-tab-btn {
    padding: 12px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 500;
    color: var(--text-secondary);
    transition: border-color 0.2s ease, color 0.2s ease;
    margin-bottom: -2px; /* Sits on top of the container border */
    
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.game-tab-btn:hover {
    color: var(--text-primary);
}

.game-tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}


/* ============================================
   2. CARDS (Content Containers)
   ============================================ */

.game-card {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

/* Responsive padding for smaller screens */
@media (max-width: 640px) {
    .game-card {
        padding: 18px;
    }
}


/* ============================================
   3. CARD SECTION HEADINGS
   ============================================ */

.card-section-heading {
    margin: 0 0 16px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.8em;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* For headings that appear after content (not first in card) */
.card-section-heading + * {
    margin-top: 0px;
}

/* Remove the margin from buttons after headings in card-header */
.card-header .card-section-heading + .icon-btn {
    margin-top: 0;
}

/* Card header with action button */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 16px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.card-header .card-section-heading {
    border-bottom: none;
    margin: 0;
    padding: 0;
}


/* ============================================
   4. EDIT & SAVE BUTTON STYLES
   ============================================ */

.icon-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background-color: var(--bg-hover);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-secondary);
    transition: stroke 0.2s ease;
}

.icon-btn:hover svg {
    stroke: var(--primary-color);
}

/* Save mode styling */
.icon-btn.is-save-mode {
    background-color: #7eb894;
}

.icon-btn.is-save-mode:hover {
    background-color: #6da784;
}

.icon-btn.is-save-mode svg {
    stroke: white;
}


/* ============================================
   5. MOODLET / TRAIT BUBBLE STYLES
   ============================================ */

.bubble-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.bubble-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #d1d5db; /* Light grey default */
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    transition: transform 0.1s ease-out;
    cursor: help;
}

.bubble-item:hover {
    transform: translateY(-1px);
}

/* Moodlet specific variant */
.bubble-item.moodlet {
    background-color: var(--primary-light);
}

/* Trait specific variant */
.bubble-item.trait {
    background-color: var(--accent-color);
}

.bubble-item .bubble-name {
    color: inherit;
    font-weight: 500;
}

.bubble-item .bubble-secondary {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.8);
    font-style: normal;
}


/* ============================================
   6. VITAL BARS (Progress/Stat Bars)
   ============================================ */

.stat-bar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-bar-label {
    font-weight: 500;
    font-size: 0.75em;
    color: var(--text-secondary);
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-bar {
    flex: 1;
    height: 18px;
    background-color: #e9ecef;
    border-radius: 9px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    position: relative;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 9px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: static;
    background-color: var(--c-accent-01);
}

/* Subtle shine effect */
.stat-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.15), transparent);
    border-radius: 8px 8px 0 0;
}

.stat-bar-value {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75em;
    font-weight: 600;
    z-index: 2;
    white-space: nowrap;
    transition: color 0.3s ease;
    color: white;
    right: 10px;
    left: auto;
}

/* For low values, display outside the bar */
.stat-bar-value.is-low {
    color: var(--text-secondary);
    right: auto;
    margin-left: 5px;
}


/* ============================================
   7. DROPDOWN STYLES
   ============================================ */

.game-dropdown {
    width: 100%;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: white;
    font-family: inherit;
    font-size: 0.9em;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.game-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(139, 122, 168, 0.2);
}

.game-dropdown:hover {
    border-color: var(--primary-color);
}


/* ============================================
   8. TEXT INPUT STYLES
   ============================================ */

.game-input {
    width: 100%;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-family: inherit;
    font-size: 0.9em;
    color: var(--text-primary);
    background-color: white;
    transition: all 0.2s ease;
}

.game-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(139, 122, 168, 0.2);
}

.game-input:hover:not(:focus) {
    border-color: var(--primary-color);
}

/* Smaller variant for inline editing */
.game-input.inline {
    padding: 4px 6px;
}


/* ============================================
   9. CARD SUB-HEADINGS (Detail Labels)
   ============================================ */

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--border-light);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9em;
}


/* ============================================
   10. STANDARD PARAGRAPH / DATA FONT
   ============================================ */


 .h5 {
    font-family: Quicksand, sans-serif;
    font-weight: 600;
    font-size: .9em;
    margin: 0;}

.game-text {
    color: var(--text-primary);
    font-size: 0.9em;
    line-height: 1.6;
    margin: 0;
}

.game-text.muted {
    color: var(--text-muted);
}

.game-text.secondary {
    color: var(--text-secondary);
}

.game-text.italic {
    font-style: italic;
}

.game-text.center {
    text-align: center;
}

/* For empty state messages */
.game-text.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 5px 0;
    font-style: italic;
}


/* ============================================
   11. SELECTABLE LIST ITEMS
   ============================================ */

.list-container {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 10px; /* Space for scrollbar */
}

.list-item {
    width: 100%;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background-color: var(--bg-main);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.list-item:hover {
    background-color: var(--bg-hover);
    border-color: var(--accent-light);
}

.list-item.active {
    background-color: var(--c-accent-01);
    border-color: var(--c-accent-01);
    color: white;
    box-shadow: 0 2px 8px rgba(139, 122, 168, 0.2);
}

.list-item-title {
    font-family: Quicksand, sans-serif;
    font-weight: 600;
    font-size: .9em;
    margin: 0;
}

.list-item-details {
    font-size: 0.8em;
    opacity: 0.8;
    margin: 4px 0 0 0;
}

.list-item.active .list-item-details {
    color: white;
}


/* ============================================
   12. STANDARD BUTTONS
   ============================================ */

.game-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-card);
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 0.9em;
}

.game-btn:hover {
    background-color: var(--c-accent-01);
    border-color: var(--c-accent-01);
    color: white;
}

.game-btn:active {
    transform: scale(0.98);
}

.game-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.game-btn:disabled:hover {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}


/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden {
    display: none;
}

.mt-24 {
    margin-top: 24px;
}

.mb-16 {
    margin-bottom: 16px;
}

.mb-24 {
    margin-bottom: 24px;
}


/* ============================================
   OTHER ELEMENTS
   ============================================ */


/* DATA TABLE */

.game-table {
    width: 100%;
    border-collapse: collapse; /* Ensures clean, single lines */
    margin-top: 16px; /* Adds space between heading and table */
}

.game-table th {
    /* Styled based on your .card-section-heading */
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-light); /* Header row border */
    font-size: 0.8em;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: left;
}

.game-table td {
    /* Style for data cells */
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light); /* Thin grey line between rows */
    color: var(--text-secondary);
    font-size: 0.9em;
    vertical-align: middle;
}

/* Make the first column (names) stand out */
.game-table tbody td:first-child {
    color: var(--text-primary);
    font-weight: 500;
}

/* Add a hover effect to rows */
.game-table tbody tr:hover td {
    background-color: var(--bg-hover);
}

/* Remove border from the very last row for a cleaner look */
.game-table tbody tr:last-child td {
    border-bottom: none;
}

/* Style for links inside tables */
.game-table .game-link {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
}
.game-table .game-link:hover {
    text-decoration: underline;
}


/* GAME TIPS */

/* --- Global Tip Component (Text Only) --- */
.game-tip {
    background-color: #f8faff; 
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--c-accent-01); 
    border-radius: 4px;
    padding: 12px 16px;
    margin-top: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.game-tip-text {
    font-size: 0.85em;
    line-height: 1.5;
    color: var(--text-primary);
    margin: 0;
}

.game-tip-text a {
    color: var(--c-accent-01);
    font-weight: 600;
    text-decoration: none;
}

.game-tip-text a:hover {
    text-decoration: underline;
}

/* ============================================
   USAGE EXAMPLES (Comment out in production)
   ============================================ */

/*

<!-- CIRCLE TAB NAVIGATION -->
<div class="tab-circle-container">
    <button class="tab-circle-btn active" data-view="overview">
        <i class="fa-solid fa-circle-info"></i>
    </button>
    <button class="tab-circle-btn" data-view="genetics">
        <i class="fa-solid fa-dna"></i>
    </button>
</div>


<!-- CARD WITH HEADING -->
<div class="game-card">
    <h2 class="card-section-heading">Details</h2>
    <p class="game-text">Your content here</p>
</div>


<!-- CARD WITH HEADER AND EDIT BUTTON -->
<div class="game-card">
    <div class="card-header">
        <h2 class="card-section-heading">Hair Options</h2>
        <button class="icon-btn">
            <svg>...</svg>
        </button>
    </div>
</div>


<!-- BUBBLES (MOODLETS/TRAITS) -->
<div class="bubble-list">
    <div class="bubble-item moodlet">
        <span class="bubble-name">Happy</span>
        <span class="bubble-secondary">2h</span>
    </div>
    <div class="bubble-item trait">
        <span class="bubble-name">Brave</span>
    </div>
    <div class="bubble-item">
        <span class="bubble-name">Custom</span>
    </div>
</div>


<!-- STAT BAR -->
<div class="stat-bar-wrapper">
    <span class="stat-bar-label">Health</span>
    <div class="stat-bar-container">
        <div class="stat-bar">
            <div class="stat-bar-fill" style="width: 75%;"></div>
            <span class="stat-bar-value">75%</span>
        </div>
    </div>
</div>


<!-- DROPDOWN -->
<select class="game-dropdown">
    <option>Option 1</option>
    <option>Option 2</option>
</select>


<!-- TEXT INPUT -->
<input type="text" class="game-input" placeholder="Enter stable name">


<!-- DETAIL ROW -->
<div class="detail-row">
    <span class="detail-label">Age</span>
    <span class="detail-value">3 years</span>
</div>


<!-- SELECTABLE LIST (e.g., Horse List) -->
<div class="list-container">
    <button class="list-item active">
        <div class="list-item-title">Thunder</div>
        <div class="list-item-details">Arabian, 5 years, Mare</div>
    </button>
    <button class="list-item">
        <div class="list-item-title">Storm</div>
        <div class="list-item-details">Thoroughbred, 3 years, Stallion</div>
    </button>
</div>


<!-- STANDARD BUTTON -->
<button class="game-btn">Order Test</button>


<!-- STANDARD TEXT -->
<p class="game-text">This is standard body text.</p>
<p class="game-text muted">This is muted text.</p>
<p class="game-text empty-state">No active moodlets.</p>

*/