/* Custom styles for footnotes */
a.footnote-ref {
    color: forestgreen;
    /* Change the color to green */
}

/* Custom styles for sup tags */
sup {
    font-size: 1.5em;
    /* Increase the font size */
    vertical-align: baseline;
    /* Reset the vertical alignment */
}

/* Increase the font size for divs with the class 'footnote' */
div.footnote {
    font-size: 1.0em !important;
    /* Adjust the size as needed */
    color: rgba(34, 139, 34, 0.708) !important;
    /* Change the color to green */
}

a:hover {
    /* font-weight: bold; */
    color: rgb(255, 166, 0) !important;
    /* background-color: yellow !important; */
    /* text-shadow: 2px 2px 4px #000000; */
    /* font-size: 1.2em; */
}

html {
    scroll-behavior: smooth;
}


/* Custom Tooltip Styles */
.custom-tooltip {
    position: absolute;
    opacity: 0;
    background: rgba(0, 0, 0, 0.8);
    /* Darker background */
    color: white;
    padding: 8px 12px;
    /* Slightly larger padding */
    border-radius: 4px;
    font-size: 0.8rem;
    /* Smaller font size */
    pointer-events: none;
    /* Ignore mouse events initially */
    transition: opacity 0.2s ease-in-out;
    z-index: 1000;
    /* Ensure it's above other elements */
    max-width: 300px;
    /* Prevent very wide tooltips */
    white-space: normal;
    /* Allow text wrapping */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.custom-tooltip.visible {
    opacity: 1;
    pointer-events: auto;
    /* Allow interaction when visible/pinned */
}

/* Style for links inside tooltips */
.custom-tooltip a {
    color: #8ab4f8;
    /* Light blue for links */
    text-decoration: underline;
}

.custom-tooltip a:hover {
    color: #aecbfa;
    /* Lighter blue on hover */
}

/* Style for hr inside tooltips */
.custom-tooltip hr {
    border: 0;
    border-top: 1px solid #555;
    /* Darker gray line */
    margin: 4px 0;
    /* Adjust spacing */
}

/* Style for finance item numbers */
.finance-item-number {
    background-color: var(--md-default-fg-color--lightest);
    color: var(--md-default-fg-color--light);
    font-family: 'Roboto Mono', monospace;
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 8px;
    margin-top: 4px;
    display: inline-block;
    letter-spacing: 0.5px;
    border: 1px solid var(--md-code-bg-color);
}

.weather-card {
    background-color: #f8f9fa;
    /* Light grey background */
    border-radius: 12px;
    /* Rounded corners */
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    /* Subtle shadow */
    max-width: 300px;
    /* Adjust as needed */
    margin: 20px auto;
    /* Center the card if it's in a block */
    text-align: center;
    /* Center text within the card */
    color: #333;
    /* Darker text color for better readability */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    /* Modern system font stack */
    position: relative;
    /* Added for tooltip positioning context */
}

.weather-card .weather-header {
    margin-bottom: 15px;
    /* border-bottom: 1px solid #e9ecef; */
    /* Removed */
    /* padding-bottom: 10px; */
    /* Removed, adjust margin-bottom if needed or add padding to content below */
}

#day-cycle-gradient-bar {
    height: 3px;
    /* Adjust thickness as desired */
    width: 100%;
    margin-top: 10px;
    /* Space between location text and bar */
    border-radius: 1.5px;
    /* Optional: for rounded ends */
    position: relative;
    /* For positioning indicators */
}

.time-indicator {
    position: absolute;
    top: 50%;
    /* Vertically center on the bar's axis */
    z-index: 1;
    /* Ensure indicators are above the bar's background */
    display: none; /* Hide by default until positioned by JavaScript */
}

#sunrise-indicator,
#sunset-indicator {
    width: 6px;
    height: 6px;
    background-color: white;
    border: 1px solid #333;
    /* Dark border for hollow effect */
    border-radius: 50%;
    transform: translate(-50%, -50%);
    /* Center the circle on its 'left' position */
}

#current-time-indicator {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 6px solid #333;
    /* Upward pointing triangle */
    transform: translate(-50%, 5px);
    /* Tip will align with top: 50% (bar's axis) */
}

.weather-card p.weather-location {
    font-size: 1.3em;
    font-weight: 500;
    color: #212529;
}

.weather-card p.weather-icon {
    /* display: none; */
    /* Hide if you are sure you won't use it */
    /* Or ensure it's empty and doesn't take space if JS clears it */
    min-height: 20px;
    /* Prevent collapse if it were to hold an icon */
}

.weather-card .weather-body p {
    margin: 8px 0;
    font-size: 1em;
}

.weather-card p.weather-temp {
    /* Changed from .weather-card .weather-temp to be more specific */
    font-size: 5em;
    /* Increased from 2.5em */
    font-weight: bold;
    /* color: #007bff; */
    /* Color will be set by JavaScript */
    /* A primary color for emphasis */
    margin-top: 0px;
}

.weather-card p.weather-feels {
    font-size: 0.8em;
    color: #555;
    display: flex;
    /* Use flex to align arrow and text */
    align-items: center;
    /* Vertically align items in the flex container */
    justify-content: center;
    /* Center the content (arrow + text) */
}

.feels-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    margin-right: 5px;
    /* Space between arrow and text */
    /* vertical-align: middle; Removed, using flexbox alignment on parent */
}

.feels-arrow.up-warm {
    /* Feels colder: upward arrow, warm color */
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #FF8C00;
    /* DarkOrange */
}

.feels-arrow.down-cold {
    /* Feels warmer: downward arrow, cold color */
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #87CEEB;
    /* SkyBlue */
}

/* Remove old keyframes */
/* @keyframes revealFromLeft { ... } */
/* @keyframes revealFromLeftLoop { ... } */

/* New keyframes for the "thinking" shimmer effect */
@keyframes thinkingShimmer {
    0% {
        background-position: 100% center;
        /* Gradient starts off-screen to the right */
    }

    100% {
        background-position: -100% center;
        /* Gradient has moved off-screen to the left */
    }
}

.weather-card p.weather-desc {
    font-size: 1.75em;
    /* Fallback color for browsers that don't support background-clip: text */
    color: #495057;

    /* Gradient for the shimmer effect */
    background-image: linear-gradient(to right,
            #495057 20%,
            /* Base text color */
            #49505700 50%,
            /* Slightly lighter shimmer/highlight color */
            #495057 80%
            /* Base text color */
        );
    background-size: 200% auto;
    /* Make the gradient wider than the element */

    /* Clip the background to the text */
    -webkit-background-clip: text;
    background-clip: text;

    /* Make the text itself transparent to show the gradient background */
    /* This overrides the color property above for supporting browsers */
    color: transparent;

    animation: thinkingShimmer 1.75s infinite linear;
    /* Adjust duration for desired speed */
    margin-top: 30px;
    margin-bottom: -8px;
}

.weather-card p.weather-sun-info {
    font-size: 0.8em;
    color: #6c757da7;
    /* A slightly muted color */
    margin-top: 0px;
}

.time-indicator-tooltip {
    position: absolute;
    background-color: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.75em;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    pointer-events: none;
    /* Tooltip itself should not capture mouse events */
    z-index: 10;
    /* Ensure it's above other indicators if overlapping */
    white-space: nowrap;
}

.time-indicator-tooltip.visible {
    opacity: 1;
    visibility: visible;
}

/* Styles for the hourly forecast card - REMOVED */
/* .hourly-forecast-card { ... } */
/* .hourly-forecast-card h3 { ... } */
/* .hourly-forecast-container { ... } */
/* .hourly-item { ... } */
/* .hourly-item:last-child { ... } */
/* .hourly-item .time { ... } */
/* .hourly-item .temp { ... } */

/* Dynamic border animations for cards */

/* Remove old keyframes */
/* @keyframes marching-ants-orange { ... } */
/* @keyframes marching-ants-green { ... } */

/* New shared keyframes for marching ants */
@keyframes marching-ants {
    0% {
        background-position: 0 0;
    }
    100% {
        /* Shift by the full background-size to complete one cycle */
        background-position: 14px 14px; /* Corresponds to background-size */
    }
}

.dynamic-border {
    border-width: 2px;
    border-style: solid;
    border-color: transparent; /* Actual border is transparent */
    padding: 2px; /* Create space for the background to act as the border */
    background-clip: padding-box; /* Confine background to the padding area */
    position: relative; /* Ensures proper layering if needed */
}

.dynamic-border-orange {
    background-image: repeating-linear-gradient(
        -45deg,
        transparent 0px,      /* Start of the pattern, fully transparent */
        orange 1px,           /* Color starts to fade in, reaching full orange at 1px */
        orange 4px,           /* Solid orange part of the stripe */
        transparent 5px,      /* Color starts to fade out, fully transparent at 5px */
        transparent 10px      /* Remainder of the pattern is transparent (gap) */
    );
    background-size: 14px 14px; /* Size of the repeating pattern tile */
    animation: marching-ants 0.8s linear infinite; /* Use the new shared animation */
}

.dynamic-border-green {
    background-image: repeating-linear-gradient(
        -45deg,
        transparent 0px,      /* Start of the pattern, fully transparent */
        lightgreen 1px,       /* Color starts to fade in, reaching full lightgreen at 1px */
        lightgreen 4px,       /* Solid lightgreen part of the stripe */
        transparent 5px,      /* Color starts to fade out, fully transparent at 5px */
        transparent 10px      /* Remainder of the pattern is transparent (gap) */
    );
    background-size: 14px 14px; /* Size of the repeating pattern tile */
    animation: marching-ants 0.8s linear infinite; /* Use the new shared animation */
}

/* Consolidated navigation hiding styles */
.custom-style .md-tabs { display: none !important; }
.custom-style .md-nav__item--nested:not(.md-nav__item--active) { display: none !important; }
.custom-style .md-nav__link[rel="prev"],
.custom-style .md-nav__link[rel="next"] { display: none !important; }

/* Custom Citation Styles */
.citation {
    font-size: 0.9em;
    line-height: 1.4;
}

/* APS-style numeric citation links */
.citation-link {
    color: #1a73e8;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
}

.citation-link:hover {
    color: #0d47a1;
    text-decoration: underline;
}

/* Citation tooltip styling */
.citation-tooltip {
    position: absolute !important;
    background-color: #2d3748 !important;
    color: white !important;
    padding: 20px 24px !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
    max-width: 600px !important;
    z-index: 1000 !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3) !important;
    display: none !important;
    border: 1px solid #4a5568 !important;
    font-family: inherit !important;
    font-weight: normal !important;
    pointer-events: none !important; /* Add this line */
}

.citation-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #2d3748;
}

.citation-authors {
    color: #333;
}

.citation-title {
    font-weight: normal;
    color: #333;
}

/* Bibliography title styling - bold and colored */
.citation-title-bibliography {
    font-weight: bold;
    color: #1a73e8;
}

.citation-journal {
    color: #333;
}

.citation-year {
    color: #f59e0b;
    font-weight: 600;
}

/* APS-style bibliography numbering */
.citation-number {
    font-weight: bold;
    color: #333;
    margin-right: 0.5em;
}

/* Citation links in bibliography */
.citation-link-arxiv {
    background-color: #b31b1b;
    color: white !important;
    padding: 2px 6px;
    border-radius: 3px;
    text-decoration: none !important;
    font-size: 0.85em;
    font-weight: bold;
    margin-left: 4px;
}

.citation-link-arxiv:hover {
    background-color: #a01616 !important;
    color: white !important;
}

.citation-link-doi {
    background-color: #1976d2;
    color: white !important;
    padding: 2px 6px;
    border-radius: 3px;
    text-decoration: none !important;
    font-size: 0.85em;
    font-weight: bold;
    margin-left: 4px;
}

.citation-link-doi:hover {
    background-color: #1565c0 !important;
    color: white !important;
}

/* Legacy styles for backward compatibility */
.citation-arxiv {
    background-color: #b31b1b;
    color: white !important;
    padding: 2px 6px;
    border-radius: 3px;
    text-decoration: none !important;
    font-size: 0.85em;
    font-weight: bold;
    margin-left: 4px;
}

.citation-arxiv:hover {
    background-color: #a01616 !important;
    color: white !important;
}

.citation-arxiv-text {
    color: white !important;
}

.citation-doi {
    background-color: #1976d2;
    color: white !important;
    padding: 2px 6px;
    border-radius: 3px;
    text-decoration: none !important;
    font-size: 0.85em;
    font-weight: bold;
    margin-left: 4px;
}

.citation-doi:hover {
    background-color: #1565c0 !important;
    color: white !important;
}

.citation-missing {
    color: #d32f2f;
    font-weight: bold;
    background-color: #ffebee;
    padding: 1px 4px;
    border-radius: 2px;
}

/* Bibliography section styling */
.bibliography-container {
    margin-top: 2em;
    padding-top: 1em;
    border-top: 1px solid #e0e0e0;
}

.bibliography-entry {
    margin-bottom: 1em;
    padding: 0.5em 0;
    border-bottom: 1px solid #f5f5f5;
}

.bibliography-entry:last-child {
    border-bottom: none;
}

/* Tooltip for finance account icons and cards */
a[title]:has(> .twemoji),
a[title]:has(> img[src*="cards/"]) {
    position: relative;
    /* Needed for tooltip positioning */
}

a[title]:has(> .twemoji):hover::after,
a[title]:has(> img[src*="cards/"]):hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 5px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    z-index: 1001;
    pointer-events: none;
}
