/* Basic Styling */
body { 
    font-family: system-ui, sans-serif; 
    background-color: #f8f9fa; 
    color: #333; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    min-height: 100vh; 
    padding: 20px; 
    box-sizing: border-box; 
    margin: 0; 
}
.content-container { 
    background-color: #ffffff; 
    padding: 20px 30px; 
    border-radius: 12px; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); 
    max-width: 900px; 
    width: 100%; 
    margin-bottom: 20px; 
}
.dashboard-container { 
    padding-top: 30px; 
    padding-bottom: 30px;
    position: relative; /* CRITICAL FIX: Needed for the loader overlay */
}
h1, h2, h3 { 
    color: #0056b3; 
    margin-bottom: 15px; 
    text-align: center; 
}
h3, h4 { 
    margin-top: 25px; 
    margin-bottom: 10px; 
    text-align: left; 
    color: #0056b3; 
}
h4 { 
    margin-top: 20px; 
    font-size: 1.1em;
}
.gauge-container h3, .line-chart-container h3 { 
    text-align: center; 
}
p, ul { 
    color: #555; 
    line-height: 1.6; 
    text-align: left; 
    margin-bottom: 15px; 
}
ul { 
    list-style-position: outside; 
    padding-left: 20px; 
}
li { 
    margin-bottom: 8px; 
}
.chart-gauge-wrapper { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 30px; 
    align-items: flex-start;
    justify-content: center; 
    margin-top: 20px; 
    min-height: 200px; 
}

/* GAUGE STYLES */
.gauge-container { 
    position: relative; 
    width: 300px; 
    margin: 0 auto 30px auto;
    text-align: center; 
    flex-shrink: 0; 
}
.gauge-wrapper {
  position: relative;
  height: 150px;
  width: 300px;
}
.gauge {
    width: 300px; height: 150px; position: relative;
    overflow: hidden; margin: 0 auto;
}
.gauge-arc {
    width: 300px; height: 300px; border-radius: 50%;
    position: absolute; top: 0; left: 0;
    background: conic-gradient(
        from -90deg,
        #a02531 0deg 36deg, #dc3545 36deg 72deg, #ffc107 72deg 108deg,
        #28a745 108deg 144deg, #1a6e30 144deg 180deg
    );
}
.gauge-arc::before {
    content: ''; position: absolute; top: 15%; left: 15%; right: 15%;
    bottom: 15%; background: #ffffff; border-radius: 50%; z-index: 1;
}
.gauge-needle {
    width: 4px; height: 120px; background-color: #333; border-radius: 2px;
    position: absolute; bottom: 0; left: 50%;
    transform-origin: bottom center; transform: translateX(-50%) rotate(0deg);
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 2;
}
.gauge-center-cap {
  position: absolute; width: 20px; height: 20px; background: #333;
  border-radius: 50%; bottom: -10px; left: 50%;
  transform: translateX(-50%); z-index: 3;
}
.gauge-text-area {
  padding-top: 5px; text-align: center;
}
.gauge-number { 
    font-size: 3em; font-weight: bold; line-height: 1; 
    display: inline-block; margin-bottom: 5px; margin-right: 5px;
}
.gauge-label { 
    font-size: 1.3em; font-weight: 500;
    color: #555; display: block;
}
#comparisonIndicator {
    display: inline-block; width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent;
    vertical-align: middle; margin-bottom: 10px; transition: all 0.3s;
}
#comparisonIndicator.up { border-bottom: 14px solid #28a745; }
#comparisonIndicator.down { border-top: 14px solid #dc3545; }

/* LINE CHART STYLES */
.line-chart-container { 
    flex-grow: 1; min-width: 300px; width: 100%; 
    position: relative; height: 400px;
    margin-top: -20px;
    display: flex;
    flex-direction: column;
}
#timePeriodSelector { 
    text-align: right; margin-bottom: 10px; 
}
#timePeriodSelector button { 
    padding: 5px 10px; margin-left: 5px; cursor: pointer; border: 1px solid #ccc; 
    background-color: #eee; border-radius: 4px; font-size: 0.9em; 
}
#timePeriodSelector button.active { 
    background-color: #0056b3; color: white; border-color: #00408a; font-weight: bold; 
}
#timePeriodSelector button:hover:not(.active) { background-color: #ddd; }
canvas { display: block; max-width: 100%; box-sizing: border-box; }

/* FEAR & GREED COLOR CLASSES */
.fear { color: #dc3545; font-weight: bold;} 
.extreme-fear { color: #a02531; font-weight: bold;}
.neutral { color: #ffc107; font-weight: bold;} 
.greed { color: #28a745; font-weight: bold;}
.extreme-greed { color: #1a6e30; font-weight: bold;}

/* INFO & CHART INTERACTION STYLES */
.info-section { margin-top: 30px; }
#lineChart { cursor: grab; }
#lineChart:active { cursor: grabbing; }

/* NAVIGATION/MODE SELECTOR STYLES */
.mode-selector {
    text-align: center;
    margin-bottom: 25px;
}
.mode-btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 1em;
    cursor: pointer;
    border: 1px solid #ccc;
    background-color: #eee;
    border-radius: 4px;
    margin: 0 5px;
    transition: background-color 0.2s;
    text-decoration: none; /* For the 'a' tag version */
    color: #333;
}
.mode-btn.active {
    background-color: #0056b3;
    color: white;
    border-color: #00408a;
    font-weight: bold;
}
.mode-btn:hover:not(.active) {
    background-color: #ddd;
}

/* ===== NEW SKELETON LOADER AND SPINNER STYLES ===== */
.dashboard-container.is-loading .chart-gauge-wrapper {
    opacity: 0.2; /* Makes the content underneath look grayed out */
    filter: blur(2px);
    transition: opacity 0.3s, filter 0.3s;
}
#loader-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10;
    display: none; /* Hidden by default */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
}
/* Show the loader when the container is loading */
.is-loading #loader-overlay {
    display: flex;
}
.spinner {
    width: 40px; height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #0056b3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}
#loadingMessage { 
    font-style: italic; color: #555; font-size: 1.1em; 
}

@keyframes spin { to { transform: rotate(360deg); } }

#loadingMessage::after {
    content: '.';
    animation: dots 1.5s steps(4, end) infinite;
}
@keyframes dots {
    0% { content: "."; }
    25% { content: ".."; }
    50% { content: "..."; }
    75%, 100% { content: "...."; }
}
/* ===== Ad Blocker Overlay Styles ===== */

#adblock-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;(0, 0, 0, 0.8);
    z-index: 9999;
    display: none; /* Initially hidden */
    justify-content: center;
    align-items: center;
    text-align: center;
}

.adblock-modal {
    background-color: #ffffff;
    padding: 30px 40px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.4);
}

.adblock-modal h2 {
    color: #b30000; /* Dark red for the title */
    margin-top: 0;
}

.adblock-modal p {
    color: #333;
    font-size: 1.1em;
    line-height: 1.6;
}