/* Variables */
:root {
    --bg-color: #efefef;
    --text-color: #777777;
    --disabled-text-color: #cccccc;
    --active-section-bg: white;
    --separator-color: #cccccc;
    --button-bg: #dddddd;
    --button-text: #333333;
    --button-highlight: #f0f0f0;
    --info-bg: #d0d0d0;
    --tesla-blue: #0077ff;
    --tesla-red: #ff0000;
    --button-radius: 13px;
    --weather-switch-slider: #ffffff;
    --weather-warning-color: #ff7700;
    --status-poor: #E65100;    /* Yellow for poor connection */
    --status-good: #0fa215;    /* Green for good connection */
    --status-unavailable: #888888;  /* Gray for unavailable/bad connection */
    --status-rain: #00a1ff;    /* Blue for rain indicator */
    --heading-font-size: 17pt;
    --heading-font-weight: 500;
    --stock-up: #0fa215;       /* Green for positive market change */
    --stock-down: #dc3545;     /* Red for negative market change */
    --stock-neutral: #888888;  /* Gray for unchanged market */
}

body.dark-mode {
    --bg-color: #1d1d1d;
    --text-color: #777777;
    --disabled-text-color: #444444;
    --active-section-bg: #333333;
    --separator-color: #444444;
    --button-bg: #333333;
    --button-text: #d6d6d6;
    --button-highlight: #bdbdbd;
    --info-bg: #302f39;
    --weather-switch-slider: #222222;
    --weather-warning-color: #ff9900;
    --status-poor: #ffcd27;    /* Yellow for poor connection */
    --status-good: #5eff19;    /* Green for good connection */
    --status-unavailable: #888888;  /* Gray for unavailable/bad connection */
    --status-rain: #4fb8ff;    /* Blue for rain indicator */
    --stock-up: #3ad45b;       /* Brighter green for dark mode */
    --stock-down: #ff4d5e;     /* Brighter red for dark mode */
    --stock-neutral: #888888;  /* Same gray for unchanged market */
}


/* Basic HTML Elements */

* {
    font-family: "Inter";
    font-optical-sizing: auto;
    font-variant-ligatures: all;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 16pt;
    padding: 0;
    text-align: left;
    /* font-weight: 400; */
}

a {
    color: var(--tesla-blue);
    text-decoration: none;
    font-weight: 500;
}

h1 {
    color: var(--button-text);
    font-size: 19pt;
    margin-bottom: 15px;
    text-align: left;
    margin-top: 0px;
    font-weight: 250;
}

h2 {
    color: var(--button-text);
    font-size: var(--heading-font-size);
    margin-bottom: 9px;
    margin-top: 28px;
    font-weight: var(--heading-font-weight);
}

h3 {
    color: var(--button-text);
    font-size: calc(var(--heading-font-size) - 1pt);
    font-weight: calc(var(--heading-font-weight) - 100);
    margin-bottom: 7px;
    margin-top: 16px;
}

p {
    margin-top: 12px;
    margin-bottom: 12px;
    text-align: justify;
    max-width: 980px;
}

ul {
    padding-left: 25px;
    margin-top: 0px;
    margin-bottom: 0px;
    text-align: justify;
    max-width: 940px;
}

li {
    margin: 11px 0;
    padding-left: 0px;
    margin-left: 0px;
}

hr {
    border: 0;
    border-top: 1px solid var(--separator-color);
    margin-top: 28px;
    margin-bottom: 28px;
}

/* About */
.announcement p {
    background-color: #03a8f422;
    color: var(--button-text);
    border-radius: var(--button-radius);
    padding: 18px;
    font-style: none;
    font-weight: 500;
    font-style: italic;
    text-align: center;
    /* text-transform: uppercase; */
    max-width: 840px;
    place-self: left;
}


/* Layout */

.frame-container {
    display: flex;
    height: 100vh;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden; /* Prevent scrolling on the frame-container */
}

.left-frame {
    width: 300px;
    flex-shrink: 0;
    overflow-y: auto;
    padding: 10px 10px 5px 15px;
    box-sizing: border-box; /* Include padding in height calculations */
    scrollbar-gutter: stable;
    scrollbar-width: thin;
}

.right-frame {
    flex-grow: 1;
    height: 100%; /* Ensure it spans the full height of the container */
    overflow-y: auto; /* Enable scrolling for the right frame */
    padding: 20px 45px 20px 15px;
    box-sizing: border-box; /* Include padding in the height calculation */
    scrollbar-width: thin; /* Use a thin scrollbar */
    position: relative; /* Add positioning context for the absolute positioned external-site */
}

/* Scroll indicators that fade content at top/bottom when more content is available */
.scroll-indicator {
    position: fixed; /* Fixed position so they don't move when scrolling */
    left: 300px; /* Match the width of the left frame */
    right: 10px;
    height: 64px; /* Increased height for better visibility */
    pointer-events: none; /* Let mouse events pass through */
    opacity: 0; /* Start hidden */
    transition: opacity 0.3s ease;
    z-index: 100; /* Ensure it's above most content */
}

.top-fade {
    top: 0;
    background: linear-gradient(to bottom, var(--bg-color), transparent);
}

.bottom-fade {
    bottom: 0;
    background: linear-gradient(to top, var(--bg-color), transparent);
}

.section {
    display: none;
}

.hidden {
    display: none !important;
}

/* External site container */
#external-site {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  display: none;
  overflow: hidden;
  padding: 0;
  margin: 0;
}

#external-site iframe {
  width: 100%;
  height: 100%;
  border: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0;
  margin: 0;
}


/* Navigation */

.section-buttons {
    position: relative;
    display: flex;
    flex-direction: column;
    /* margin: 0; */
    /* padding: 0; */
    width: auto;
    max-height: 100%; /* Ensure it doesn't exceed the container height */
    box-sizing: border-box; /* Include padding in height calculations */
}

.section-button {
    color: var(--text-color);
    border-radius: var(--button-radius);
    font-weight: 600;
    /* letter-spacing: 0.025em; */
    background-color: var(--bg-color);
    font-size: 19pt;
    padding: 16px 20px;
    border: none;
    cursor: pointer;
    /* text-align: left; */
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    transition: background-color 0.3s, color 0.3s;
}

/* Section button that also has disabled class */
.section-button.disabled {
    color: var(--disabled-text-color) !important;
    cursor: not-allowed;
}

.section-button.disabled:hover {
    background-color: var(--bg-color);
}

.logout-button {
    color: var(--button-text);
    background-color: var(--button-bg);
    border-radius: var(--button-radius);
    font-size: 16pt;
    font-weight: 600;
    padding: 16px 20px;
    border: none;
    cursor: pointer;
    text-align: center;
    margin-top: 15px;
    width: auto;
    transition: background-color 0.3s;
}

.logout-button:hover {
    background-color: var(--active-section-bg);
}

.button-icon {
    width: 24px;
    height: 24px;
    margin-right: 14px;
    stroke: currentColor;
    /* flex-shrink: 0; */
}

.section-button.active {
    background-color: var(--active-section-bg);
    color: var(--button-text);
}

.section-button:hover {
    background-color: var(--active-section-bg);
}


/* Notification dot section */

.section-button.has-notification {
    position: relative;
}

.section-button.has-notification::after {
    content: attr(data-count);      /* Use the data-count attribute for counter text */
    position: absolute;
    top: 50%;                       /* Center vertically */
    right: 10px;                    /* Position to the right of text instead of left */
    transform: translateY(-50%);    /* Perfect vertical centering */
    min-width: 20px;                /* Minimum width for the counter */
    height: 26px;                   /* Taller to accommodate text */
    background-color: var(--tesla-blue);
    border-radius: 13px;            /* Rounded pill shape */
    display: flex;                  /* Use flex to center the counter text */
    justify-content: center;        /* Center horizontally */
    align-items: center;            /* Center vertically */
    color: white;                 /* White text */
    font-size: 12pt;                /* Small font size */
    font-weight: 750;
    padding: 0px 9px;
    opacity: 1;                     /* Full opacity by default */
    transition: opacity 0.5s ease;  /* Smooth transition for opacity */
}

/* Add fade-out effect for the notification dot */
.section-button.notification-transition {
    position: relative;
}

.section-button.notification-transition::after {
    opacity: 0;                    /* Fade to transparent */
    transition: opacity 0.5s ease;  /* Smooth transition for opacity */
}


/* Link Button Lists */

.button-list {
    list-style: none;
    padding: 0;
    margin-top: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, 280px);
    gap: 15px;
    justify-content: start;
    max-width: calc(280px * 5 + 16px * 4); /* Limit to 5 columns */
}

.button-list li {
    margin: 0;
}

.button-list a {
    color: var(--button-text);
    background-color: var(--button-bg);
    border-radius: var(--button-radius);
    display: flex;
    padding-top: 23px;
    padding-bottom: 23px;
    padding-left: 5px;
    padding-right: 5px;
    transition: background-color 0.3s;
    width: auto;
    font-weight: 600;
    /* height: 40px; */
    align-items: center;
    justify-content: center;
    gap: 11px;
    /* text-align: center; */
}

.button-list a img {
    height: 36px;
    width: auto;
    border-radius: 7px;
}


/* Enhanced Image Visibility Classes */

.img-adaptive,
.img-adaptive-light-invert,
.img-adaptive-dark-invert {
    /* Base styling shared by all image adaptive classes */
    filter: grayscale(100%) contrast(1.5);
    transition: filter 0.3s;
}

/* Invert colors only in light mode */
body:not(.dark-mode) .img-adaptive,
body:not(.dark-mode) .img-adaptive-light-invert {
    filter: invert(100%);
}

/* Invert colors only in dark mode */
body.dark-mode .img-adaptive-dark-invert {
    filter: invert(100%);
}

/* Make white areas in images transparent */
.img-white-transparent {
    /* Remove the inverting filters */
    mix-blend-mode: multiply; /* Keep this to make white transparent */
    transition: filter 0.3s;
}

/* Add specific dark mode handling */
body.dark-mode .img-white-transparent {
    mix-blend-mode: screen; /* In dark mode, use screen blend mode to make white transparent */
    filter: invert(100%) brightness(125%); /* Invert colors and slightly increase brightness for better visibility */
}


/* Indicator container */

.control-container {
    position: fixed;
    top: -3px;
    right: 11px;
    display: flex;
    align-items: center;
    background-color: var(--bg-color);
    border-radius: 5px;
    padding: 8px 2px;
    z-index: 100;
    opacity: 0.80;
    transition: transform 0.2s ease-out;
    transform-origin: right center;
    will-change: transform;
}

.status-indicator {
    width: 24px;
    height: 24px;
    margin-right: 11px;
    margin-left: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}


/* Network Status Indicator */

.network-status {
    color: var(--status-unavailable);
}

.network-status.unavailable {
    color: var(--status-unavailable);
}

.network-status.poor {
    color: var(--status-poor);
}

.network-status.good {
    color: var(--status-good);
}

.network-status svg {
    width: 24px;
    height: 24px;
}

.network-status .network-bar {
    transition: fill 0.3s ease;
}

.network-status.unavailable .network-bar {
    fill: var(--status-unavailable);
}

.network-status.poor .bar-1 {
    fill: var(--status-poor);
}

.network-status.poor .bar-2,
.network-status.poor .bar-3,
.network-status.poor .bar-4 {
    fill: var(--status-unavailable);
}

.network-status.fair .bar-1,
.network-status.fair .bar-2 {
    fill: var(--status-poor);
}

.network-status.fair .bar-3,
.network-status.fair .bar-4 {
    fill: var(--status-unavailable);
}

.network-status.good .bar-1,
.network-status.good .bar-2,
.network-status.good .bar-3 {
    fill: var(--status-good);
}

.network-status.good .bar-4 {
    fill: var(--status-unavailable);
}

.network-status.excellent .bar-1,
.network-status.excellent .bar-2,
.network-status.excellent .bar-3,
.network-status.excellent .bar-4 {
    fill: var(--status-good);
}


/* GPS Status Indicator */

.gps-status.unavailable {
    color: var(--status-unavailable); /* Using the shared variable */
}

.gps-status.poor {
    color: var(--status-poor); /* Using the shared variable */
}

.gps-status.good {
    color: var(--status-good); /* Using the shared variable */
}

.gps-status {
    color: var(--status-unavailable);
}


/* Rain Status Indicator */

.rain-status {
    color: var(--weather-warning-color); /* Changed to orange weather warning color */
    animation: pulse-rain 2s infinite;
}

@keyframes pulse-rain {
    0% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.7;
    }
}


/* Stock Status Indicator */

.stock-status {
    width: auto;
    font-size: 12pt;
    font-weight: 600;
    transition: color 0.3s ease;
    font-variant-numeric: tabular-nums;
}

.stock-status.up {
    color: var(--status-good);
}

.stock-status.down {
    color: var(--stock-down);
}

.stock-status.neutral {
    color: var(--stock-neutral);
}


/* Data Display */

.data-info, .data-info-column {
    row-gap: 18px;
    /* max-width: 1080px; */
    width: auto; /* Ensure it spans full width */
}

.data-info {
    display: grid;
    grid-template-columns: repeat(auto-fill, 240px);
    column-gap: 28px;
}

.data-info-column {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
}

.data-info-column .data-item {
    margin-right: 0; /* Ensure no extra margin */
    width: auto; /* Ensure items span full width */
}

.data-item {
    color: var(--button-text);
    font-weight: 600;
    font-size: var(--heading-font-size);
    display: block;
    margin-right: 0;
    padding-top: 0px;
}

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

.data-item h2 {
    color: var(--text-color);
    margin-top: 0px;
    margin-bottom: 4px;
}


/* Stats  */

.nav-container {
    display: flex;
    gap: 50px;
    margin: 30px 0px -25px 0px;
    align-items: flex-start;
}

.nav-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 10px 0 0 0;
    width: 400px;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: left;
    min-width: 200px;
    height: 125px; /* fixed height added */
}

.value-container {
    display: flex;
    align-items: center; /* Vertically align items in container */
}

.stat-value {
    color: var(--button-text);
    font-size: 52pt;
    font-weight: 500;
    /* display: inline; */
    font-variant-numeric: tabular-nums;
}

.stat-unit {
    color: var(--text-color);
    font-size: 24pt;
    font-weight: 600;
    font-family: sans-serif;
    /* display: inline; */
    margin-left: 5px; /* Add some spacing between value and unit */
}

.stat-label {
    color: var(--text-color);
    font-size: 13pt;
    font-weight: 500;
    margin-top: 0px;
    display: block; /* Ensure it's on its own line */
    clear: both; /* Clear the float to ensure it appears below */
}


/* Dashboard Display */

.radar-container {
    position: relative;
    padding-top: 30px; /* Added padding to push radar down */
    margin-right: 30px;
}

.radar-title {
    position: absolute;
    top: 0px;
    left: 24px;
    text-align: center;
    margin: 0;
}

#radarDisplay {
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.1);
}

.dark-mode #radarDisplay {
    background-color: rgba(255, 255, 255, 0.1);
}


/* Waze frame */

.teslawaze-container {
    height: calc(100vh - 370px);
    min-height: 280px;
    margin-bottom: 0; /* Ensure no bottom margin */
    position: relative; /* Add positioning context */
}

#teslawaze {
    border-radius: var(--button-radius);
    width: 100%;
    height: 100%;
    border: none;
}


/* News Elements */

.news-headlines {
    margin: 24px 0;
}

.news-item {
    background-color: var(--button-bg);
    border-radius: var(--button-radius);
    margin-bottom: 15px;
    padding: 9px 9px 9px 61px;
    max-width: 1200px;
    cursor: pointer;
    position: relative;  /* Added for absolute positioning of the favicon */
}

.news-item:hover {
    background-color: var(--button-bg); /* Keep the hover color consistent */
}

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

.news-source {
    font-weight: 675;
    margin-right: 10px;
    font-size: 11.5pt;
}

.news-time {
    font-size: 12.5pt;
    margin-left: 5px;
    font-weight: 500;
    transition: color 0.3s ease, font-weight 0.3s ease;
}

/* Add styling for new article timestamps */
.news-time.news-new-time {
    color: var(--tesla-blue);
    font-weight: 600;
}

/* Add transition class for when an item is being marked as seen */
.news-time.news-seen-transition {
    transition: color 1.5s ease, font-weight 1.5s ease;
}

.news-title {
    color: var(--button-text);
    margin-top: 0px;
    padding-bottom: 5px;
    margin-right: 55px; /* avoid indicators */
    font-size: 16pt;
    font-weight: 500;
}

.news-favicon {
    position: absolute;             /* Position absolutely within the news-item */
    left: 15px;                     /* Position on the left side with some padding */
    top: 50%;                       /* Center vertically */
    transform: translateY(-50%);    /* Perfect vertical centering */
    width: 32px;                    /* Slightly increased width */
    height: 32px;                   /* Slightly increased height */
    border-radius: 4px;             /* Optional: adds a slight rounding to the icons */
    opacity: 0.8;
}

.share-icon {
    position: absolute;
    right: 21px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
}

body.dark-mode .share-icon img {
    filter: brightness(0) invert(0.8) grayscale(1);
}


/* Notification System */

#notification-container {
    position: fixed;
    top: 20px;
    left: 50%; /* Center horizontally */
    transform: translateX(-50%); /* Offset by half width for true centering */
    z-index: 9999;
    max-width: 80%; /* Allow more width */
    min-width: 200px;
}

.notification {
    display: flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.75);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s, transform 0.3s;
    white-space: nowrap; /* Keep on one line */
    width: auto; /* Size to content */
    display: inline-flex; /* Only take needed width */
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification.hide {
    opacity: 0;
    transform: translateY(-20px);
}

.notification-icon {
    margin-right: 12px;
    color: var(--weather-warning-color); /* Match the orange warning color */
}

.notification-message {
    font-size: 14pt;
    font-weight: 500;
    color: #ff9500; /* Bright orange color for text */
    white-space: nowrap; /* Ensure text stays on one line */
}


/* Loading Spinner */

.loading-container {
    display: flex; /* Initially visible */
    justify-content: center;
    align-items: center;
    height: 200px;
    margin: 20px 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--tesla-blue);
    animation: spin 1s linear infinite;
}

body.dark-mode .spinner {
    border-color: rgba(255, 255, 255, 0.1);
    border-top-color: var(--tesla-blue);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.content-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    margin: 20px 0;
}


/* Login Styles */

.login-button {
    color: var(--button-text);
    background-color: var(--button-bg);
    border-radius: var(--button-radius);
    font-size: 16pt;
    font-weight: 600;
    padding: 16px 20px;
    border: none;
    cursor: pointer;
    text-align: center;
    margin-top: 15px;
    width: 100%;
    transition: background-color 0.3s;
}

.login-button:hover {
    background-color: var(--active-section-bg);
}


/* Modal Login Dialog */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

.modal-content {
    font-size: 14pt;
    background-color: var(--bg-color);
    border-radius: var(--button-radius);
    padding: 25px;
    padding-top: 0px;
    max-width: 90%;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.75);
}

/* Login form */
.login-form {
    margin-top: 20px;
}

.login-form label {
    font-weight: 500;
    font-size: 14pt;
    width: 80px;
    margin-right: 15px;
    margin-bottom: 10px;
    color: var(--button-text);
    vertical-align: middle;
}

.login-form input {
    font-size: 16px;
    width: calc(100% - 90px);
    padding: 12px 15px;
    border: 2px solid var(--separator-color);
    border-radius: 8px;
    background-color: var(--active-section-bg);
    color: var(--button-text);
    box-sizing: border-box;
    vertical-align: middle;
}

.button-container {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-button {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.modal-button.cancel {
    background-color: var(--button-bg);
    color: var(--button-text);
}

.modal-button.submit {
    background-color: var(--tesla-blue);
    color: white;
}

.error-message {
    color: var(--tesla-red);
    margin-bottom: 20px;
    font-size: 14px;
    min-height: 20px;
}


/* Settings Section Styles */

.settings-controls {
    margin-top: -9px;
    display: grid;
    grid-template-columns: repeat(auto-fill, 470px);
    gap: 0px 11px; /* row gap, column gap */
}

.settings-toggle-item {
    display: flex;
    align-items: center;
    background-color: var(--button-bg);
    border-radius: var(--button-radius);
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 12px;
    padding-bottom: 12px;
    margin-top: 9px;
    max-width: 480px;
    font-weight: 550;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.settings-toggle-item label {
    flex-grow: 1; /* Make label take up all available space */
    cursor: inherit;
}

.settings-toggle-item input {
    opacity: 0; /* Hide the checkbox */
    width: 0;
    height: 0;
    position: absolute;
}

.settings-toggle-item span.settings-toggle-slider {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 32px;
    flex-shrink: 0; /* Prevent slider from shrinking */
}

.settings-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #aaa;
    transition: .4s;
    border-radius: 30px;
}

.settings-toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.settings-description {
    margin-top: 2pt;
    font-size: 12.5pt;
    font-style: italic;
    margin-left: 11pt;
    text-align: right;
}

input:checked + .settings-toggle-slider {
    background-color: var(--tesla-blue);
}

input:focus + .settings-toggle-slider {
    box-shadow: 0 0 1px var(--tesla-blue);
}

input:checked + .settings-toggle-slider:before {
    transform: translateX(26px);
}


/* Settings Text Item */

.settings-text-item {
    cursor: initial; /* Prevent cursor change on text input */
}

.settings-text-item input[type="text"] {
    opacity: 100%;
    width: 320px;
    height: 19px;
    position: relative;
    padding: 8px 14px;
    border-width: 0px;
    border-radius: 9px;
    background: var(--bg-color);
    color: var(--button-text);
    font-size: 14pt;
    font-weight: 500;
    text-align: right;
}

body.dark-mode .settings-text-item input[type="text"]:disabled {
    background: #333333;
    color: #555555;
}

.settings-text-item input[type="text"]:focus {
    outline: var(--tesla-blue) solid 2px;
}

#in-map-toggle {
    position: absolute;
    margin: 0px;
    padding: 7px;
    z-index: 10;
    background-color: transparent;
    opacity: 80%;
}

#in-map-toggle .option-switch {
    background-color: var(--button-bg);
}

#in-map-toggle .option-button {
    font-size: 12pt;
    font-weight: 700;
}

#in-map-toggle {
    position: absolute;
    margin: 0px;
    padding: 7px;
    z-index: 10;
    background-color: transparent;
    opacity: 80%;
}

#in-map-toggle .option-switch {
    background-color: var(--button-bg);
}

#in-map-toggle .option-button {
    font-size: 12pt;
    font-weight: 700;
}


/* Option Switch (Two-option selector) */

.option-switch-container {
    padding-right: 15px; /* Ensure there's adequate right padding */
    padding-top: 11px;
    padding-bottom: 11px;
    cursor: initial;
}

.option-switch {
    display: flex;
    border-radius: calc(var(--button-radius) - 2px);
    overflow: hidden;
    background-color: var(--button-highlight);
}

.option-button {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 14px;
    color: var(--text-color);
    font-size: 14pt;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.option-button.active {
    background-color: var(--tesla-blue);
    color: white;
}

.option-button:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
}

body.dark-mode .option-button:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.1);
}


/* News Source Grid */

.news-source-grid {
    grid-template-columns: repeat(auto-fill, 310px);
    gap: 0px 10px;
    width: auto;
}

.news-toggle-item {
    padding: 9px 15px;
    margin-bottom: 0px;
    margin-top: 7px;
    max-width: none;
    width: auto;
    border-radius: 9px;
}

.news-toggle-item {
    font-size: 15pt;
}

/* Additional section-specific styling */
#satellite {
    padding-top: 30px;
}


/* Mobile Landscape Mode */
@media only screen and (max-width: 900px) {
    :root {
        --heading-font-size: 14pt;
        --heading-font-weight: 500;
        --button-radius: 10px;
    }
    
    body {
        font-size: 12pt;
    }
    
    h1 {
        font-size: 16pt;
        margin-bottom: 5px;
    }
    
    h2 {
        margin-top: 14px;
        margin-bottom: 7px;
    }
    
    /* Layout adjustment */
    .frame-container {
        flex-direction: column;
    }
    
    /* Convert left menu to horizontal top menu */
    .left-frame {
        width: 100%;
        height: auto;
        max-height: 90px;
        padding: 5px;
        overflow-y: hidden;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Hide scrollbar for Firefox */
    }
    
    .left-frame::-webkit-scrollbar {
        display: none; /* Hide scrollbar for Chrome/Safari */
    }
    
    /* Convert section buttons to horizontal layout */
    .section-buttons {
        flex-direction: row;
        min-width: min-content;
        width: auto;
        /* height: 80px; */
        overflow-x: auto;
    }
    
    .section-buttons h1 {
        display: none; /* Hide title to save space */
    }
    
    .section-button {
        font-size: 14pt;
        padding: 0px 9px;
        /* margin: 0 3px; */
        white-space: nowrap;
        height: 40px;
    }
    
    .button-icon {
        width: 16px;
        height: 16px;
        margin-right: 8px;
    }
    
    /* Right frame takes remaining space */
    .right-frame {
        height: calc(100vh - 90px);
        padding: 10px 15px;
    }
    
    /* Dashboard adjustments */
    .nav-container {
        gap: 20px;
        margin: 10px 0px -15px 0px;
    }
    
    .radar-container {
        padding-top: 20px;
        margin-right: 15px;
    }
    
    #radarDisplay {
        width: 150px;
        height: 150px;
    }
    
    .stat-box {
        height: 90px;
    }
    
    .stat-value {
        font-size: 36pt;
    }
    
    .stat-unit {
        font-size: 18pt;
    }
    
    .stat-label {
        font-size: 11pt;
    }
    
    /* Teslawaze container adjustment */
    .teslawaze-container {
        height: calc(100vh - 300px);
        min-height: 200px;
    }
    
    /* Button lists */
    .button-list {
        grid-template-columns: repeat(auto-fill, 220px);
        gap: 10px;
    }
    
    .button-list a {
        padding: 15px 5px;
        height: 30px;
        font-size: 13pt;
    }
    
    /* News items */
    .news-item {
        padding: 8px 8px 8px 50px;
    }
    
    .news-favicon {
        width: 26px;
        height: 26px;
    }
    
    .news-title {
        font-size: 13pt;
        margin-right: 40px;
    }
    
    /* Settings adjustments */
    .settings-controls {
        grid-template-columns: repeat(auto-fill, 300px);
    }
    
    .settings-toggle-item {
        padding: 8px 10px;
        font-size: 12pt;
    }
    
    .settings-toggle-item span.settings-toggle-slider {
        width: 50px;
        height: 26px;
    }
    
    .settings-toggle-slider:before {
        height: 20px;
        width: 20px;
    }
    
    input:checked + .settings-toggle-slider:before {
        transform: translateX(22px);
    }
    
    /* Text input fields in settings */
    .settings-text-item input[type="text"] {
        width: 200px;
        height: 16px;
        padding: 6px 12px;
        font-size: 12pt; 
    }
    
    /* Option Switch adjustments for mobile */
    .option-button {
        font-size: 11pt;
        padding: 6px 10px;
    }
    
    #in-map-toggle .option-button {
        font-size: 10pt;
        font-weight: 600;
    }
    
    /* Logout button adjustment */
    .logout-button {
        font-size: 14pt;
        padding: 12px 16px;
    }
    
    /* News sources grid */
    .news-source-grid {
        grid-template-columns: repeat(auto-fill, 240px);
    }
    
    .news-toggle-item {
        font-size: 11pt;
    }
    
    /* Control container (top right) */
    .control-container {
        top: 85px;
        right: 10px;
        padding: 5px 10px;
        transform: scale(0.8); /* Always keep in shrunk mode */
        opacity: 0.8; /* Consistent opacity */
        transition: none; /* Disable transitions */
        will-change: auto; /* Disable will-change optimization */
    }
    
    .toggle-label {
        font-size: 13pt;
    }
    
    /* Login button */
    .login-button {
        margin-top: 10px;
        padding: 10px 15px;
        font-size: 14pt;
    }
}
