:root {
    --primary-color: #007aff;
    --text-color: #1d1d1f;
    --text-secondary: #86868b;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

html {
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-color);
    background-color: #f5f5f7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    z-index: -1;
    opacity: 0.3;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

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

/* Container */
.container {
    width: 90%;
    max-width: 1000px;
    padding: 2rem;
    animation: fadeIn 0.8s ease-out;
    box-sizing: border-box;
}

/* ... (Header styles skipped for brevity if not changing) ... */

/* ... */

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

.text-right {
    text-align: right;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, #1d1d1f 0%, #434344 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
}

/* Glass Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    padding: 2rem;
    overflow: hidden;
    word-break: keep-all;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

/* Controls */
.controls {
    display: flex;
    justify-content: flex-end;
    /* Align date to right */
    align-items: center;
    margin-bottom: 1.5rem;
}

.glass-button {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-color);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.glass-button:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.glass-button:active {
    transform: translateY(0);
}

.last-updated {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Table */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.4);
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
    /* Keep numbers on one line */
}

th,
td {
    padding: 0.8rem 0.5rem;
    /* Reduced horizontal padding */
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Allow Name column to wrap if needed */
td:nth-child(3),
th:nth-child(3) {
    white-space: normal;
    min-width: 120px;
}

th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    /* Slightly smaller */
    text-align: center;
    /* Force center alignment */
}

td {
    font-size: 0.9rem;
    color: var(--text-color);
}

.text-right {
    text-align: right;
}

.highlight {
    color: var(--primary-color);
    font-weight: 700;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.5);
}

/* Footer Note */
.footer-note {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.loading-text {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Stock Links */
.stock-link {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
    cursor: pointer;
}

.stock-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Clickable Cells */
.clickable {
    cursor: pointer;
    transition: color 0.2s;
}

.clickable:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Toast Notification */
.toast {
    visibility: hidden;
    min-width: 250px;
    margin-left: -125px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    text-align: center;
    border-radius: 50px;
    padding: 16px;
    position: fixed;
    z-index: 1000;
    left: 50%;
    bottom: 30px;
    font-size: 14px;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.5s, bottom 0.5s;
}

.toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 50px;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Formula Container */
.formula-container {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.formula-container h3 {
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.formula-item {
    margin-bottom: 1rem;
    padding-left: 1rem;
    border-left: 3px solid #ddd;
}

.formula-item:last-child {
    margin-bottom: 0;
}

.formula-item p {
    margin: 0.3rem 0 0 0;
    font-size: 0.9rem;
    color: var(--text-color);
    line-height: 1.5;
}

.badge-green {
    color: #2ecc71;
    font-weight: 700;
}

.badge-blue {
    color: #3498db;
    font-weight: 700;
}

.badge-red {
    color: #e74c3c;
    font-weight: 700;
}

.text-green {
    color: #2ecc71;
    font-weight: 600;
}

.text-blue {
    color: #3498db;
    font-weight: 600;
}

.note {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Filter Tabs */
.tabs-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.tab-button {
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    /* Darker border */
    background: rgba(255, 255, 255, 0.6);
    /* More opaque white */
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.95rem;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    /* Subtle shadow */
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tab-button.active {
    background: var(--primary-color, #3498db);
    /* Fallback or variable */
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

/* Site Footer */
.site-footer {
    width: 90%;
    max-width: 1000px;
    margin: 2.5rem auto 1rem auto;
    padding: 0 2rem;
    animation: fadeIn 0.8s ease-out;
}

.footer-inner {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 1.5rem;
}

.footer-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 0.8rem 0;
    letter-spacing: 0.02em;
}

.footer-disclaimer p {
    font-size: 0.68rem;
    color: #999;
    line-height: 1.6;
    margin: 0 0 0.4rem 0;
}

.footer-disclaimer p:last-child {
    margin-bottom: 0;
}

/* Footer Links */
.footer-links {
    margin-top: 0.8rem;
    text-align: center;
}

.footer-links a {
    font-size: 0.65rem;
    color: #999;
    text-decoration: none;
    transition: color 0.2s ease;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.15);
    padding-bottom: 1px;
}

.footer-links a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.footer-copyright {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.footer-copyright p {
    font-size: 0.62rem;
    color: #aaa;
    text-align: center;
    margin: 0;
    letter-spacing: 0.03em;
}

/* Privacy Policy Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    padding: 1.5rem 1.8rem 1rem 1.8rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.modal-body {
    padding: 1.2rem 1.8rem;
    overflow-y: auto;
    flex: 1;
}

.policy-section {
    margin-bottom: 1.2rem;
}

.policy-section:last-child {
    margin-bottom: 0;
}

.policy-section h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 0.4rem 0;
}

.policy-section p {
    font-size: 0.78rem;
    color: #666;
    line-height: 1.65;
    margin: 0 0 0.35rem 0;
}

.policy-section p:last-child {
    margin-bottom: 0;
}

.policy-section a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 122, 255, 0.3);
}

.policy-section a:hover {
    border-bottom-color: var(--primary-color);
}

.contact-email {
    font-weight: 600;
    color: var(--text-color) !important;
}

.modal-close-btn {
    display: block;
    width: calc(100% - 3.6rem);
    margin: 0 1.8rem 1.5rem 1.8rem;
    padding: 0.75rem;
    border: none;
    border-radius: 12px;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.modal-close-btn:hover {
    background: #0066d6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.modal-close-btn:active {
    transform: translateY(0);
}

/* Responsive */
/* Responsive Card Layout */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
        width: 95%;
    }

    h1 {
        font-size: 1.8rem;
    }

    .glass-panel {
        padding: 1rem;
    }

    /* Force table to not be like tables anymore */
    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    /* Hide table headers (but not display: none;, for accessibility) */
    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        margin-bottom: 1rem;
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.6);
        padding: 1rem;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    }

    td {
        /* Behave like a "row" */
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-top: 1rem;
        padding-bottom: 1rem;
        /* Flexbox for layout */
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        /* Removed huge padding-left */
    }

    td:before {
        /* Now like a table header */
        /* Flex item */
        font-weight: bold;
        color: var(--text-secondary);
        content: attr(data-label);
        text-align: left;
        padding-right: 1rem;
        white-space: nowrap;
        flex-shrink: 0;
        /* Prevent label from shrinking */
    }

    td:last-child {
        border-bottom: 0;
    }

    /* Specific adjustments for cell content */
    td.text-right {
        text-align: right;
    }

    /* Allow name to wrap but align right */
    td:nth-child(2) {
        text-align: right;
        white-space: normal;
        word-break: keep-all;
        overflow-wrap: break-word;
        align-items: flex-start;
        max-width: 100%;
    }
}