:root {
    --bg-color: #0A120C;
    --card-bg: #0d0d0d;
    --card-border: #1a1a1a;
    --deepGreen0: #0B120C;
    --deepGreen1: #0E1C0F;
    --deepGreen1: #0F2413;
    /* same with pe modeling */
    --deepGreen2: #0F2A10;

    --text-primary: #ffffff;
    --text-secondary: #8c8c8c;
    --accent-color: #34a853;
    /* Green for up */
    --down-color: #ea4335;
    /* Red for down */
    --btn-bg: #ffffff;
    --btn-text: #000000;
    --font-family: 'Google Sans', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: #facc15;
    background-color: #0b120c;
    background-color: var(--deepGreen1);

    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
}

.container {
    width: 402px;
    height: 872px;
    max-width: 100%;
    max-height: calc(100vh - 4rem);
    background-color: var(--deepGreen0);
    padding: 0 1rem;
    padding-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    box-sizing: border-box;
    border-radius: 24px;
    outline: 1px solid #fff;
    transition: max-width 0.3s ease, width 0.3s ease;
    position: relative;
    /* For absolute children like bottom sheet */
    overflow: hidden;
}

.top-banner {
    height: 54px;
    /* background-color: #ea4335; */
    margin: 0 -1rem 0 -1rem;
}

.sticky-header {
    position: sticky;
    top: 0;
    background-color: inherit;
    margin: -2rem -1rem 0 -1rem;
    padding: 0 1rem 1rem 1rem;
    z-index: 10;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    display: flex;
    flex-direction: column;
}

.app-title {
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    margin-top: 0.5rem;
}

@media (min-width: 600px) {
    .container {
        border-radius: 24px;
        box-shadow: 0 40px 100px rgba(0, 0, 0, 0.15);
    }
}

main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    overflow-y: auto;
}

/* Search Container */
.search-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 1rem;
}

.input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

input[type="text"] {
    flex: 1;
    background: #222;
    border: none;
    border-radius: 4px;
    padding: 0.8rem 1rem;
    padding-left: 44px;
    /* Space for search icon */
    color: #fff;
    font-size: 14px;
    font-family: var(--font-family);
    transition: border-color 0.1s ease, box-shadow 0.1s ease;
    height: 44px;
    box-sizing: border-box;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    pointer-events: none;
    font-size: 24px;
    z-index: 1;
}

input[type="text"]:focus {
    outline: none;
    border-color: #888;
    border-width: 1px;


}

.search-btn {
    background-color: #ffffff;
    color: #000000;
    border: none;
    padding: 0.8rem 1.5rem;
    height: 44px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    /* Space between icon and text */
}

.search-btn:hover {
    background-color: #e5e5e5;
}

.search-btn .material-symbols-outlined {
    color: #1f1f1f;
    font-size: 24px;
}

.back-btn {
    background: none;
    border: 1px solid #555;
    border-width: 0;
    border-radius: 4px;
    height: 44px;
    width: 0;
    margin-right: -0.5rem;
    /* Cancel the flex gap when width is 0 */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    box-sizing: border-box;
    opacity: 0;
    transform: translateX(-20px);
    visibility: hidden;
    overflow: hidden;
    transition: width 0.25s cubic-bezier(0.32, 0, 0, 1), margin-right 0.25s cubic-bezier(0.32, 0, 0, 1), border-width 0.25s cubic-bezier(0.32, 0, 0, 1), border-color 0.2s cubic-bezier(0.32, 0, 0, 1), color 0.2s cubic-bezier(0.32, 0, 0, 1), opacity 0.3s cubic-bezier(0.32, 0, 0, 1), transform 0.3s cubic-bezier(0.32, 0, 0, 1), visibility 0.3s cubic-bezier(0.32, 0, 0, 1);
}

.back-btn:hover {
    border-color: #81FF11;
    color: #81FF11;
}

.back-btn.visible {
    width: 44px;
    border-width: 1px;
    margin-right: 0;
    /* Restore margin */
    opacity: 1;
    transform: translateX(0);
    visibility: visible;
}

#landingContent {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 0 0 1rem 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h2 {
    margin-bottom: 0 !important;
}

.clear-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 14px;
    font-weight: 500;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

.clear-btn:hover {
    color: #ffffff;
}

.recent-section {
    max-height: 200px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.15s cubic-bezier(0.32, 0, 0, 1), opacity 0.15s cubic-bezier(0.32, 0, 0, 1);
}

.recent-section.collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: -2rem;
}

.recent-section.hidden {
    display: none;
}

.popular-section h2,
.portfolio-section h2,
.discover-section h2,
.top-movers-section h2,
.recent-section h2 {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.discover-section {
    margin-bottom: 100px;
}

.ticker-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ticker-pill {
    background-color: transparent;
    color: #ffffff;
    border: 1px solid #fff;
    height: 44px;
    padding: 0 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.ticker-pill:hover {
    border-color: #81FF11;
    color: #81FF11;
}

.pill-change {
    font-size: 0.9rem;
    font-weight: 500;
    margin-left: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 1px;
}

.pill-change.positive {
    color: #81FF11;
}

.pill-change.negative {
    color: #ff4444;
}

.ticker-pill.loading {
    background: linear-gradient(90deg, #222 25%, #333 50%, #222 75%);
    background-size: 200% 100%;
    animation: shimmer 0.75s infinite;
    border-color: #333;
    color: transparent !important;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Result Card */
.result-card {
    background: transparent;
    border: 1px solid #555;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    /* Removed overflow: hidden to prevent clipping bullets */
}

.result-card:not(.hidden) {
    animation: fadeIn 0.3s ease-out;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ticker-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.refresh-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.refresh-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.price-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.price-section h2 {
    font-size: 2rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.movement-pill {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.badge-up {
    background: rgba(52, 168, 83, 0.1);
    color: #34a853;
}

.badge-down {
    background: rgba(234, 67, 53, 0.1);
    color: #ea4335;
}

.badge-flat {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

/* Summary Box */
.summary-box {
    margin-top: 1.5rem;
}

.reason-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-top: 1.5rem;
}

/* Bullet List inside Summary Box */
.bullet-list {
    list-style-type: none;
    padding-left: 0;
}

.bullet-list li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    line-height: 1.6;
}

.bullet-list li:last-child {
    margin-bottom: 0;
}

.bullet-list li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
    top: 0.2rem;
}

.summary-header {
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Earnings Call Card */
.earnings-card {
    margin-top: 0; /* Rely on 1rem flex gap only */
    /* Inherits border and background from .result-card */
}

.earnings-title {
    color: rgba(255, 255, 255, 0.5); /* Grayish */
    font-size: 0.9rem;
    font-weight: 400;
    margin-bottom: 0.25rem;
}

.earnings-section h4 {
    color: rgba(255, 255, 255, 0.9);
    font-size: inherit; /* Inherit size like summary-header */
    font-weight: 500;
    margin-bottom: 0.75rem;
    margin-top: 1.25rem;
}

.earnings-list {
    list-style-type: none; /* Remove default bullets */
    padding-left: 0;
}

.earnings-list li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    line-height: 1.6;
}

.earnings-list li:not(.skeleton)::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
    top: 0.2rem;
}

/* Card Footer */
.card-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 2rem;
}

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

/* Skeleton Loader */
.skeleton-card {
    border-color: #111;
}

.skeleton {
    background: #1a1a1a;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    animation: shimmer .75s infinite;
}

@keyframes shimmer {
    100% {
        left: 100%;
    }
}

.skeleton-ticker {
    width: 60px;
    height: 16px;
}

.skeleton-price {
    width: 60px;
    height: 40px;
    font-weight: 500;
}

.skeleton-text {
    width: 100%;
    height: 16px;
    margin-bottom: 0.75em;
}

.skeleton-text:nth-child(3),
.skeleton-text:nth-child(5) {
    width: 40%;
}

.skeleton-text:last-child {
    margin-bottom: 0;
}

.skeleton-footer {
    width: 150px;
    height: 12px;
}

.hidden {
    display: none !important;
}

footer {
    margin-top: auto;
    padding-top: 2rem;
    text-align: left;
}

.legal-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 500px;
    margin: 0 auto;
    opacity: 0.7;
}



.legal-text a {
    color: var(--text-primary);
    text-decoration: underline;
}

.btn-icon {
    margin-right: 0.5rem;
    vertical-align: middle;
    font-size: 16px;
}



@keyframes flash-box {
    0% {
        border-color: #1a1a1a;
        box-shadow: none;
    }

    50% {
        border-color: #fff;
        box-shadow: 0 0 0 1px #fff, 0 0 10px #fff;
    }

    100% {
        border-color: #1a1a1a;
        box-shadow: none;
    }
}

.flash-active {
    border-color: #fff;
    box-shadow: 0 0 0 1px #fff, 0 0 10px #fff;
}

@media (max-width: 440px),
(max-height: 956px) {
    .container {
        width: 100% !important;
        height: 100vh !important;
        max-width: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        outline: none !important;
        border: none !important;
    }

    body {
        padding: 0 !important;
        background-color: var(--deepGreen0) !important;
    }

    .top-banner {
        display: none !important;
    }
}

/* Info Icon */
.info-icon {
    font-size: 16px !important;
    width: 16px;
    height: 16px;
    cursor: pointer;
    vertical-align: middle;
    margin-left: 4px;
    color: #fff;
}

/* Bottom Sheet */
.bottom-sheet {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    visibility: visible;
    pointer-events: auto;
    transition: visibility 0s linear 0s;
}

.bottom-sheet.hidden {
    visibility: hidden;
    pointer-events: none;
}

.bottom-sheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 250ms cubic-bezier(0.32, 0, 0, 1);
}

.bottom-sheet .bottom-sheet-overlay {
    opacity: 1;
}

.bottom-sheet.hidden .bottom-sheet-overlay {
    opacity: 0;
}

.bottom-sheet-content {
    position: relative;
    background: #1A1A1A;
    border-radius: 0;
    padding: 1.5rem 1.5rem 54px 1.5rem;
    transform: translateY(100%);
    transition: transform 250ms cubic-bezier(0.32, 0, 0, 1);
    max-height: 50vh;
    overflow-y: auto;
    border-top: none;
}

.bottom-sheet .bottom-sheet-content {
    transform: translateY(0);
}

.bottom-sheet.hidden .bottom-sheet-content {
    transform: translateY(100%);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(100%);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.bottom-sheet:not(.hidden) .bottom-sheet-content {
    animation: slideUp 250ms cubic-bezier(0.32, 0, 0, 1) forwards;
}

.bottom-sheet:not(.hidden) .bottom-sheet-overlay {
    animation: fadeIn 250ms cubic-bezier(0.32, 0, 0, 1) forwards;
}

.bottom-sheet.closing .bottom-sheet-content {
    animation: slideDown 250ms cubic-bezier(0.32, 0, 0, 1) forwards;
}

.bottom-sheet.closing .bottom-sheet-overlay {
    animation: fadeOut 250ms cubic-bezier(0.32, 0, 0, 1) forwards;
}

.bottom-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.bottom-sheet-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    font-family: var(--font-family);
}

.bottom-sheet-body {
    color: #fff;
    font-size: 1rem;
    line-height: 1.6;
    font-family: var(--font-family);
}

.bottom-sheet-body p {
    margin-bottom: 1rem;
}

.dismiss-btn {
    width: 100%;
    background: none;
    border: 1px solid #fff;
    border-radius: 4px;
    padding: 0.8rem 1rem;
    color: #fff;
    font-size: 1rem;
    font-family: var(--font-family);
    cursor: pointer;
    margin-top: 1.5rem;
    transition: background 0.2s ease;
}

.dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Market Summary Card */
.market-summary-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px 16px;
    font-family: var(--font-family);
}

.indices-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 0.9rem;
}

.index-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.index-item .val {
    font-weight: 400;
}

.index-item.positive .val {
    color: #81FF11;
}

.index-item.negative .val {
    color: #ff4444;
}

.market-summary-text {
    color: #aaa;
    line-height: 1.4;
    font-size: 0.85rem;
    font-weight: 300;
}

.market-summary-text.skeleton {
    color: transparent !important;
    min-height: 1.2rem;
}