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

body {
    font-family: 'Arial', sans-serif;
    background-color: #000000;
    color: #ffffff;
}

.container {
    max-width: none;
    margin: 0;
    padding: 15px;
    width: 100vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: #111111;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(255,255,255,0.1);
    margin-bottom: 15px;
    border: 1px solid #333333;
}

.header-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.control-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.middle-column {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    flex: 1;
}

.right-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.ticker-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ticker-row input {
    width: 80px;
}

.greek-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.load-row {
    display: flex;
}

.checkboxes-row {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: flex-end;
}

.theme-row {
    display: flex;
    justify-content: flex-end;
}

.favorites-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.star-button {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.star-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.star-button.favorited {
    color: #ffd700;
}

.favorites-container {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.favorites-container label {
    font-size: 14px;
    color: #ffffff;
    font-weight: bold;
}

.favorites-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.favorite-item {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    border: 1px solid #555555;
    transition: all 0.2s;
    position: relative;
}

.favorite-item:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #777777;
}

.favorite-item.active {
    background: #0066ff;
    border-color: #0066ff;
}

.favorite-remove {
    margin-left: 6px;
    font-size: 11px;
    opacity: 0.7;
    cursor: pointer;
}

.favorite-remove:hover {
    opacity: 1;
    color: #ff4444;
}

.right-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}



.left-controls input {
    padding: 8px 12px;
    border: 1px solid #555555;
    border-radius: 4px;
    font-size: 16px;
    text-transform: uppercase;
    background-color: #222222;
    color: #ffffff;
    min-width: 120px;
}

.left-controls button {
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    white-space: nowrap;
}

.left-controls button:hover {
    background-color: #0056b3;
}

.right-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.right-controls button {
    padding: 8px 12px;
    background-color: #333333;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.right-controls button:hover {
    background-color: #555555;
}

#trend-line-toggle.active {
    background-color: #4CAF50;
    color: white;
}

#clear-trend-lines:hover {
    background-color: #dc3545;
}

.dropdown-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-container label {
    font-weight: bold;
    font-size: 14px;
    color: #ffffff;
    white-space: nowrap;
}

.dropdown-container select {
    padding: 8px 12px;
    border: 1px solid #555555;
    border-radius: 4px;
    font-size: 14px;
    background-color: #222222;
    color: #ffffff;
    min-width: 100px;
}

.favorite-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #ffffff;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background-color 0.2s;
    white-space: nowrap;
    margin: 0;
}

.favorite-label:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.favorite-label input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.shadow-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
    margin: 0;
}

.shadow-label:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.shadow-label input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.profile-header-left {
    flex: 1;
}

.profile-header-right {
    display: flex;
    align-items: center;
}

.profile-header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.profile-header p {
    color: #cccccc;
    font-size: 14px;
}


.main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
    flex: 1;
    margin-bottom: 20px;
}

/* Mobile-first responsive design */
@media (max-width: 768px) {
    body {
        padding: 0; /* No padding needed with fixed layout */
        overflow-x: hidden; /* Prevent horizontal scrolling */
        margin: 0;
    }
    
    .container {
        padding: 0;
        width: 100%;
        box-sizing: border-box;
        height: 100vh;
        display: flex;
        flex-direction: column;
    }
    
    .header {
        position: fixed !important;
        top: 57vh !important; /* Position below the chart with more space for labels */
        left: 0;
        right: 0;
        width: 100%;
        padding: 12px;
        margin: 0;
        height: 43vh; /* Take remaining space */
        overflow-y: auto; /* Allow scrolling if content is too tall */
        box-sizing: border-box;
        background: #111111; /* Ensure background is visible */
        z-index: 999; /* Below chart but above other content */
        border-top: 2px solid #333333; /* Visual separator from chart */
    }
    
    .header-controls {
        display: block !important; /* Show controls on mobile */
    }
    
    .control-grid {
        flex-direction: column;
        gap: 8px;
        align-items: stretch; /* Make all controls full width */
    }
    
    .left-column {
        width: 100%;
        display: block !important;
    }
    
    .right-column {
        display: none !important; /* Hide checkboxes on mobile */
    }
    
    .middle-column {
        display: none !important; /* Hide favorites on mobile */
    }
    
    .ticker-row {
        display: flex !important;
        flex-direction: row !important;
        gap: 5px !important;
        width: 100% !important;
        flex-wrap: wrap !important;
    }
    
    .ticker-row input,
    #ticker {
        width: 30% !important;
        padding: 6px !important;
        font-size: 14px !important;
        box-sizing: border-box !important;
        height: 36px !important;
    }
    
    .ticker-row select,
    #greek-type,
    #data-mode {
        width: 32% !important;
        padding: 6px !important;
        font-size: 14px !important;
        box-sizing: border-box !important;
        height: 36px !important;
    }
    
    .ticker-row select#expiration-select {
        width: 24% !important;
        padding: 6px !important;
        font-size: 12px !important;
        box-sizing: border-box !important;
        height: 32px !important;
    }
    
    .load-button-row {
        display: flex;
        justify-content: flex-start;
        margin-top: 6px;
        margin-bottom: 6px;
        gap: 10px;
    }
    
    .load-button-row #load-data {
        padding: 6px 12px !important;
        font-size: 14px !important;
        font-weight: normal !important;
        border: none !important;
        border-radius: 4px !important;
        background-color: #007bff !important;
        color: white !important;
        cursor: pointer !important;
        white-space: nowrap !important;
        width: auto !important;
    }
    
    .load-button-row #load-data:hover {
        background-color: #0056b3 !important;
    }
    
    
    
    
    .greek-row {
        gap: 10px;
    }
    
    
    .profile-header {
        display: none !important;
    }
    
    .main-content {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }
    
    .analytics-panel {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 15px;
        margin-top: 52vh;
    }
    
    .analytics-section.expiration-section {
        grid-column: 1;
    }
    
    .chart-container {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 100vw !important;
        height: 52vh !important; /* Reduced chart height to leave more room for x-axis labels */
        z-index: 1000;
        margin: 0 !important;
        padding: 0 !important; /* No padding for edge-to-edge */
        border-radius: 0 !important;
        order: 0;
        min-width: 0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
        overflow: hidden;
        box-sizing: border-box !important;
        background: #1a1a1a !important;
    }
    
    .chart-container canvas {
        width: 100% !important; /* Full width */
        height: 100% !important; /* Full height */
        max-width: 100vw !important;
        max-height: 52vh !important; /* Reduced to leave room for x-axis labels */
        display: block !important;
        box-sizing: border-box !important;
    }
    
    .chart-info-pane {
        display: none !important;
    }
    
    .analytics-section {
        margin-bottom: 20px;
    }
    
    .metric-row {
        padding: 10px 0;
    }
    
    .metric-label,
    .metric-value {
        font-size: 14px;
    }
    
    /* Better touch targets for mobile */
    .ticker-input button {
        min-height: 44px; /* iOS recommended touch target */
    }
    
    /* Prevent text selection on touch devices */
    .analytics-panel {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Allow page zoom outside chart, custom zoom on chart */
    .chart-container {
        touch-action: manipulation;
    }
    
    #greeksChart {
        touch-action: pinch-zoom; /* Allow pinch zoom but not pan (handled by chart) */
    }
    
    /* Show mobile expiration controls */
    .chart-expiration-overlay {
        display: none !important;
    }
    
    .mobile-controls-row {
        display: flex !important;
        margin-top: 6px;
        margin-bottom: 6px;
    }
    
    .mobile-controls-row select {
        width: 100% !important;
        padding: 6px !important;
        font-size: 14px !important;
        height: 36px !important;
        background-color: #222222;
        color: #ffffff;
        border: 1px solid #555555;
        border-radius: 4px;
    }
    
    .mobile-expiration-controls {
        display: none !important; /* Hide the old mobile expiration controls */
    }
    
    /* Mobile theme toggle visibility */
    .desktop-theme-toggle {
        display: none; /* Hide desktop theme toggle on mobile */
    }
    
    .mobile-theme-row {
        display: block; /* Show mobile theme row on mobile */
    }
    
    #theme-toggle {
        display: inline-block; /* Show mobile theme toggle */
    }
    
    /* Mobile profile header layout */
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .main-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .analytics-panel {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        width: 100%;
        height: auto;
        order: 1; /* Analytics below chart on tablet too */
    }
    
    .analytics-section.expiration-section {
        grid-column: span 2;
    }
    
    .chart-container {
        height: 450px;
        order: 0; /* Chart first on tablet */
    }
}

/* Expiration tabs styling */
.expiration-tabs {
    margin-bottom: 15px;
}

.tab-buttons {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.tab-button {
    padding: 8px 16px;
    border: 2px solid #444;
    background: #333;
    color: #ccc;
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 80px;
    text-align: center;
}

.tab-button:hover {
    background: #444;
    border-color: #555;
}

.tab-button.active {
    background: var(--tab-color, #3366CC);
    border-color: var(--tab-color, #3366CC);
    color: white;
    font-weight: bold;
}

.tab-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.current-expiration-info {
    font-size: 14px;
    font-weight: bold;
    color: #ccc;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    backdrop-filter: blur(5px);
}

/* Hide tabs on mobile - use existing mobile controls */
@media (max-width: 768px) {
    .expiration-tabs {
        display: none;
    }
    
    /* Override desktop chart container on mobile - IMPORTANT: This must come after desktop styles */
    .chart-container {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 52vh !important; /* Reduced chart area */
        z-index: 1000 !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 0 !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
        background: #1a1a1a !important;
        min-height: unset !important;
        flex: unset !important;
    }
    
    .chart-container canvas {
        width: 100% !important;
        height: 100% !important;
        max-width: 100vw !important;
        max-height: 52vh !important; /* Reduced to leave room for x-axis labels */
        display: block !important;
        box-sizing: border-box !important;
    }
}

/* Light mode tabs */
body.light-mode .tab-button {
    background: #f5f5f5;
    border-color: #ddd;
    color: #333;
}

body.light-mode .tab-button:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

body.light-mode .tab-button.active {
    color: white;
}

body.light-mode .current-expiration-info {
    color: #333;
    background: rgba(0, 0, 0, 0.05);
}

.chart-container {
    position: relative;
    background: #111111;
    padding: 20px 20px 40px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(255,255,255,0.1);
    width: 100%;
    min-height: 700px;
    display: flex;
    flex-direction: column;
    border: 1px solid #333333;
    position: relative;
    z-index: 1;
    overflow: hidden;
    
    /* Force high-quality rendering */
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

#greeksChart {
    flex: 1;
    max-width: 100%;
    max-height: 100%;
}

.chart-controls-overlay {
    position: absolute;
    top: 45px;
    right: 25px;
    z-index: 100;
    pointer-events: none;
}

.chart-controls-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(17, 17, 17, 0.9);
    border: 1px solid #333333;
    border-radius: 8px;
    padding: 8px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

.chart-control-btn {
    background: rgba(51, 51, 51, 0.9);
    color: #ffffff;
    border: 1px solid #555555;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
}

.chart-control-btn:hover {
    background: rgba(85, 85, 85, 0.9);
    border-color: #777777;
    transform: scale(1.05);
}

.chart-control-btn.star-btn.favorited {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
}

.chart-control-btn.active {
    background: rgba(76, 175, 80, 0.9);
    border-color: #4CAF50;
    color: white;
}

#greeksChart {
    flex: 1;
    min-height: 500px;
    width: 100%;
    
    /* Optimized text rendering for charts */
    font-smooth: always;
    -webkit-font-smoothing: subpixel-antialiased;
    -moz-osx-font-smoothing: auto;
    text-rendering: geometricPrecision;
    
    /* Ensure crisp rendering without conflicts */
    image-rendering: auto;
    
    /* Font optimization */
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.chart-info-pane {
    background: #1a1a1a;
    border: 1px solid #333333;
    border-radius: 6px;
    padding: 12px;
    margin-top: 15px;
    display: flex;
    gap: 20px;
    font-size: 13px;
    min-height: 40px;
    align-items: center;
}

.info-section {
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-label {
    color: #cccccc;
    font-weight: bold;
}

.info-value {
    color: #ffffff;
    font-family: monospace;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 3px;
    min-width: 60px;
}


.chart-expiration-overlay {
    position: absolute;
    bottom: 25px;
    left: 25px;
    z-index: 90;
    pointer-events: none;
}

.expiration-controls-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(17, 17, 17, 0.9);
    border: 1px solid #333333;
    border-radius: 8px;
    padding: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    max-width: 600px;
}

.mobile-expiration-controls {
    display: none; /* Hidden by default, shown on mobile */
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    border: 1px solid #333333;
}

.mobile-expiration-controls label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
}

.mobile-dropdown-wrapper {
    position: relative;
    margin-bottom: 10px;
}

.mobile-selection-display {
    width: 100%;
    padding: 8px 12px;
    background-color: #222222;
    color: #ffffff;
    border: 1px solid #555555;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    min-height: 20px;
    display: flex;
    align-items: center;
}

.mobile-selection-display:hover {
    background-color: #333333;
    border-color: #666666;
}

.mobile-expiration-controls select {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    background-color: #222222;
    color: #ffffff;
    border: 1px solid #555555;
    border-radius: 4px;
    font-size: 14px;
    max-height: 120px;
}

.expiration-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    align-items: stretch;
}

.expiration-buttons > #select-all-expirations,
.expiration-buttons > #select-none-expirations {
    display: flex;
    margin-bottom: 6px;
}

.expiration-main-row,
.expiration-shadow-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.expiration-main-row {
    margin-bottom: 4px;
}

.expiration-shadow-row {
    margin-top: 2px;
}

.expiration-buttons button {
    padding: 6px 10px;
    font-size: 12px;
    background-color: #333333;
    color: #ffffff;
    border: 1px solid #555555;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    min-width: 60px;
    white-space: nowrap;
}

.expiration-buttons button:hover {
    background-color: #444444;
}

.expiration-buttons button:active {
    background-color: #555555;
}

/* Styles for the Select All/None buttons */
.expiration-buttons #select-all-expirations,
.expiration-buttons #select-none-expirations {
    flex: 1;
    padding: 6px 12px;
    font-size: 12px;
}

/* Styles for buttons in the main and shadow rows */
.expiration-main-row button,
.expiration-shadow-row button {
    padding: 6px 10px;
    font-size: 12px;
    background-color: #333333;
    color: #ffffff;
    border: 1px solid #555555;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    min-width: 60px;
    white-space: nowrap;
}

.expiration-main-row button:hover,
.expiration-shadow-row button:hover {
    background-color: #444444;
}

.expiration-main-row button:active,
.expiration-shadow-row button:active {
    background-color: #555555;
}

/* Styles for expiration toggle buttons with colors */
.expiration-btn.active {
    background-color: var(--expiration-color, #0066ff);
    border-color: var(--expiration-color, #0088ff);
    border-width: 2px;
    color: #ffffff;
}

.expiration-btn.active:hover {
    opacity: 0.8;
}

/* Styles for shadow toggle buttons */
.expiration-shadow-btn {
    font-style: italic;
    opacity: 0.8;
}

.expiration-shadow-btn.active {
    background-color: #666600;
    border-color: #888800;
}

.expiration-shadow-btn.active:hover {
    background-color: #888800;
}

.expiration-shadow-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background-color: #222222;
}

.expiration-shadow-btn:disabled:hover {
    background-color: #222222;
}

.analytics-panel {
    background: #111111;
    border: 1px solid #333333;
    border-radius: 8px;
    padding: 20px;
    width: 100%;
    box-shadow: 0 2px 4px rgba(255,255,255,0.1);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    align-items: start;
    position: relative;
    z-index: 2;
    margin-top: 20px;
}

.panel-header {
    grid-column: 1 / -1;
    margin-bottom: 10px;
    border-bottom: 1px solid #333333;
    padding-bottom: 10px;
}

.panel-header h3 {
    margin: 0;
    font-size: 18px;
    color: #ffffff;
}

.analytics-section {
    background: rgba(26, 26, 26, 0.5);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #2a2a2a;
}

.analytics-section.expiration-section {
    grid-column: span 2;
}

.analytics-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #cccccc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #333;
    padding-bottom: 8px;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #1a1a1a;
}

.metric-row:last-child {
    border-bottom: none;
}

.metric-label {
    font-size: 13px;
    color: #cccccc;
}

.metric-value {
    font-size: 13px;
    font-weight: bold;
    color: #ffffff;
}

.positive-exposure {
    color: #00ff00 !important; /* Green for calls */
}

.negative-exposure {
    color: #ff6666 !important; /* Red for puts */
}


#greeksChart {
    max-height: 460px;
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 400px;
    font-size: 18px;
    color: #cccccc;
}

/* Theme toggle button */
#theme-toggle {
    background-color: #444444 !important;
    border: 1px solid #666666 !important;
    padding: 8px 12px !important;
    font-size: 18px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
}

#theme-toggle:hover {
    background-color: #555555 !important;
}

/* Desktop theme toggle button - hidden on mobile */
.desktop-theme-toggle {
    background-color: #444444;
    border: 1px solid #666666;
    color: #ffffff;
    padding: 10px 15px;
    font-size: 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.desktop-theme-toggle:hover {
    background-color: #555555;
}

/* Desktop layout and theme toggle visibility */
@media (min-width: 769px) {
    #theme-toggle {
        display: none; /* Hide mobile theme toggle on desktop */
    }
    
    .desktop-theme-toggle {
        display: inline-block; /* Show desktop theme toggle */
    }
    
    .mobile-controls-row {
        display: none !important; /* Hide mobile controls on desktop */
    }
    
    /* Hide expiration controls on desktop */
    .expiration-controls-panel {
        display: none;
    }
    
    .expiration-main-row,
    .expiration-shadow-row {
        display: none;
    }
    
    /* Desktop-specific layout adjustments */
    .left-column {
        display: flex !important;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .ticker-row {
        display: flex;
        gap: 8px;
        align-items: center;
    }
    
    .load-button-row {
        display: flex;
        justify-content: flex-start;
    }
    
    .mobile-theme-row {
        display: none; /* Hide mobile theme row on desktop */
    }
    
    /* Expiration select styling - match other selects */
    #expiration-select {
        min-width: 120px;
        max-width: 120px;
    }
}

/* Light mode styles */
body.light-mode {
    background-color: #ffffff;
    color: #000000;
}

body.light-mode .header,
body.light-mode .chart-container,
body.light-mode .analytics-panel {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}


body.light-mode .favorites-container label {
    color: #000000;
}

body.light-mode .favorite-item {
    background: rgba(0, 0, 0, 0.1);
    color: #000000;
    border-color: #ced4da;
}

body.light-mode .favorite-item:hover {
    background: rgba(0, 0, 0, 0.2);
    border-color: #adb5bd;
}

body.light-mode .favorite-item.active {
    background: #0066ff;
    border-color: #0066ff;
    color: #ffffff;
}

body.light-mode .star-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.flow-section {
    margin-bottom: 15px;
}

.flow-section h5 {
    font-size: 12px;
    color: #888888;
    margin: 0 0 5px 0;
    font-weight: bold;
    text-transform: uppercase;
}

.flow-item {
    font-size: 13px;
    padding: 3px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flow-strike {
    font-weight: bold;
}

.flow-change {
    font-size: 12px;
    font-weight: bold;
}

.flow-change.positive {
    color: #00ff00; /* Match gamma exposure green */
}

.flow-change.negative {
    color: #ff6666; /* Match gamma exposure red */
}

body.light-mode .flow-section h5 {
    color: #666666;
}

body.light-mode .dropdown-container label {
    color: #000000;
}

body.light-mode .dropdown-container select {
    background-color: #ffffff;
    color: #000000;
    border: 1px solid #ced4da;
}

body.light-mode .favorite-label {
    color: #000000;
}

body.light-mode .favorite-label:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .shadow-label {
    color: #000000;
}

body.light-mode .shadow-label:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .panel-header {
    border-bottom: 1px solid #dee2e6;
}

body.light-mode .panel-header h3 {
    color: #000000;
}

body.light-mode .analytics-section {
    background: rgba(248, 249, 250, 0.5);
    border: 1px solid #dee2e6;
}

body.light-mode .analytics-section h4 {
    color: #6c757d;
    border-bottom: 1px solid #dee2e6;
}

body.light-mode .metric-row {
    border-bottom: 1px solid #f1f3f4;
}

body.light-mode .metric-label {
    color: #6c757d;
}

body.light-mode .metric-value {
    color: #000000;
}

body.light-mode .positive-exposure {
    color: #28a745 !important; /* Darker green for light mode */
}

body.light-mode .negative-exposure {
    color: #dc3545 !important; /* Darker red for light mode */
}

body.light-mode .flow-change.positive {
    color: #28a745; /* Match gamma exposure green in light mode */
}


body.light-mode .left-controls input {
    background-color: #ffffff;
    color: #000000;
    border: 1px solid #ced4da;
}

body.light-mode .desktop-expiration-controls {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid #dee2e6;
}

body.light-mode .mobile-expiration-controls {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid #dee2e6;
}

body.light-mode .mobile-expiration-controls label {
    color: #000000;
}

body.light-mode .mobile-selection-display {
    background-color: #ffffff;
    color: #000000;
    border: 1px solid #ced4da;
}

body.light-mode .mobile-selection-display:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

body.light-mode .mobile-expiration-controls select {
    background-color: #ffffff;
    color: #000000;
    border: 1px solid #ced4da;
}

body.light-mode .expiration-buttons button,
body.light-mode .expiration-main-row button,
body.light-mode .expiration-shadow-row button {
    background-color: #e9ecef;
    color: #000000;
    border: 1px solid #ced4da;
}

body.light-mode .expiration-buttons button:hover,
body.light-mode .expiration-main-row button:hover,
body.light-mode .expiration-shadow-row button:hover {
    background-color: #dee2e6;
}

body.light-mode .expiration-buttons button:active,
body.light-mode .expiration-main-row button:active,
body.light-mode .expiration-shadow-row button:active {
    background-color: #ced4da;
}

/* Light mode styles for expiration toggle buttons */
body.light-mode .expiration-btn.active {
    background-color: #0066ff;
    color: #ffffff;
    border-color: #0088ff;
}

body.light-mode .expiration-btn.active:hover {
    background-color: #0088ff;
}

/* Light mode styles for shadow toggle buttons */
body.light-mode .expiration-shadow-btn.active {
    background-color: #666600;
    color: #ffffff;
    border-color: #888800;
}

body.light-mode .expiration-shadow-btn.active:hover {
    background-color: #888800;
}

body.light-mode .expiration-shadow-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background-color: #f8f9fa;
    color: #6c757d;
}

body.light-mode .expiration-shadow-btn:disabled:hover {
    background-color: #f8f9fa;
}

/* Calculator section styles */
.calculator-controls-section {
    width: 100%;
    background: #111111;
    border: 1px solid #333333;
    border-radius: 8px;
    margin-top: 20px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(255,255,255,0.1);
}

.calculator-controls-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.calculator-controls-left {
    flex: 1;
    max-width: 600px;
}

.calculator-metrics {
    background: rgba(26, 26, 26, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    min-width: 200px;
}

.slider-group {
    margin-bottom: 15px;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: #999;
}

.slider-value {
    color: #4CAF50;
    font-weight: bold;
}

.calculator-controls-section input[type="range"] {
    width: 100%;
    height: 6px;
    background: #333;
    outline: none;
    border-radius: 3px;
    -webkit-appearance: none;
}

.calculator-controls-section input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #4CAF50;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.calculator-controls-section input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #4CAF50;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
    border: none;
}

.control-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.control-item label {
    display: block;
    font-size: 0.85em;
    color: #666;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-item input,
.control-item select {
    width: 100%;
    padding: 8px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 14px;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.metric-row:last-child {
    margin-bottom: 0;
}

.metric-label-small {
    color: #999;
}

.metric-value-small {
    font-weight: bold;
}

.profit {
    color: #4CAF50;
}

.loss {
    color: #f44336;
}

/* Light mode calculator styles */
body.light-mode .calculator-controls-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

body.light-mode .calculator-metrics {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #000000;
}

body.light-mode .calculator-controls-section input[type="range"] {
    background: #ddd;
}

body.light-mode .control-item input,
body.light-mode .control-item select {
    background: #ffffff;
    color: #000000;
    border: 1px solid #ced4da;
}

body.light-mode .slider-label {
    color: #666;
}

body.light-mode .metric-label-small {
    color: #666;
}

@media (max-width: 768px) {
    .calculator-controls-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .calculator-controls-left {
        max-width: 100%;
    }
    
    .calculator-metrics {
        width: 100%;
    }
    
    .control-inputs {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* Style disabled data-mode dropdown in calculator mode */
.calculator-mode #data-mode:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #2a2a2a;
}

body.light-mode .calculator-mode #data-mode:disabled {
    background-color: #f0f0f0;
    color: #666;
}



body.light-mode .profile-header p {
    color: #6c757d;
}

body.light-mode .loading {
    color: #6c757d;
}

body.light-mode #theme-toggle {
    background-color: #e9ecef !important;
    border: 1px solid #adb5bd !important;
    color: #000000 !important;
}

body.light-mode #theme-toggle:hover {
    background-color: #dee2e6 !important;
}

body.light-mode .desktop-theme-toggle {
    background-color: #e9ecef;
    border: 1px solid #adb5bd;
    color: #000000;
}

body.light-mode .desktop-theme-toggle:hover {
    background-color: #dee2e6;
}

body.light-mode .right-controls button {
    background-color: #e9ecef !important;
    border: 1px solid #adb5bd !important;
    color: #000000 !important;
}

body.light-mode .right-controls button:hover {
    background-color: #dee2e6 !important;
}

body.light-mode #trend-line-toggle.active {
    background-color: #28a745 !important;
    color: white !important;
    border-color: #28a745 !important;
}

body.light-mode #clear-trend-lines:hover {
    background-color: #dc3545 !important;
    color: white !important;
    border-color: #dc3545 !important;
}

/* Light mode styles for floating chart controls */
body.light-mode .chart-controls-panel {
    background: rgba(248, 249, 250, 0.95);
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.light-mode .chart-control-btn {
    background: rgba(233, 236, 239, 0.9);
    color: #000000;
    border: 1px solid #adb5bd;
}

body.light-mode .chart-control-btn:hover {
    background: rgba(222, 226, 230, 0.9);
    border-color: #6c757d;
}

body.light-mode .chart-control-btn.star-btn.favorited {
    color: #ff8c00;
    background: rgba(255, 140, 0, 0.2);
    border-color: #ff8c00;
}

body.light-mode .chart-control-btn.active {
    background: rgba(40, 167, 69, 0.9);
    border-color: #28a745;
    color: white;
}

body.light-mode .chart-info-pane {
    background: #f8f9fa;
    border-color: #dee2e6;
}

body.light-mode .info-label {
    color: #6c757d;
}

body.light-mode .info-value {
    color: #000000;
    background: rgba(0, 0, 0, 0.05);
}

/* Light mode styles for expiration overlay */
/* Mobile fixed chart light mode support */
@media (max-width: 768px) {
    body.light-mode .chart-container {
        background: #f8f9fa;
        border: 1px solid #dee2e6;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }
    
    body.light-mode .header {
        background: #f8f9fa;
        border-top: 2px solid #dee2e6;
    }
}

body.light-mode .expiration-controls-panel {
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Mobile responsive adjustments for floating controls */
@media (max-width: 768px) {
    .chart-controls-overlay {
        top: 35px;
        right: 15px;
    }
    
    .chart-controls-panel {
        padding: 6px;
        gap: 6px;
    }
    
    .chart-control-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

/* Mobile Strike Price Value Bar */
.mobile-strike-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 999;
    padding: 0 10px;
    align-items: center;
}

.strike-bar-content {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #ffffff;
    gap: 8px;
}

.strike-label,
.greek-label {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
}

.strike-value,
.greek-value {
    color: #ffffff;
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
}

.strike-separator {
    color: rgba(255, 255, 255, 0.3);
    margin: 0 4px;
}

/* Show on mobile only */
@media (max-width: 768px) {
    .mobile-strike-bar {
        display: flex;
    }
    
    /* Adjust container to account for value bar */
    .container {
        padding-bottom: 32px;
    }
}

/* Light mode support for mobile strike bar */
body.light-mode .mobile-strike-bar {
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode .strike-bar-content {
    color: #000000;
}

body.light-mode .strike-label,
body.light-mode .greek-label {
    color: rgba(0, 0, 0, 0.6);
}

body.light-mode .strike-value,
body.light-mode .greek-value {
    color: #000000;
}

body.light-mode .strike-separator {
    color: rgba(0, 0, 0, 0.3);
}

/* Gamma 50 Feature Styles */
.gamma50-row {
    margin-top: 30px;
    margin-bottom: 20px;
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
    clear: both;
    position: relative;
    z-index: 1;
}

.gamma50-container {
    background: #1a1a1a;
    border: 1px solid #333333;
    border-radius: 6px;
    overflow: hidden;
    max-width: 1200px;
    margin: 0 auto;
}

.gamma50-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #222222;
    border-bottom: 1px solid #333333;
}

.gamma50-title {
    font-weight: 600;
    font-size: 13px;
    color: #ffffff;
}

.gamma50-refresh {
    cursor: pointer;
    font-size: 14px;
    color: #888888;
    transition: color 0.2s ease;
}

.gamma50-refresh:hover {
    color: #ffffff;
}

.gamma50-content {
    max-height: 250px;
    overflow-y: auto;
}

.gamma50-loading,
.gamma50-error {
    padding: 12px;
    text-align: center;
    color: #888888;
    font-size: 12px;
}

.gamma50-error {
    color: #ff6b6b;
}

.gamma50-header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
    font-size: 11px;
}

.gamma50-updated {
    color: #888888;
}

.gamma50-count {
    color: #4a9eff;
    font-weight: 500;
}

.gamma50-list {
    max-height: 200px;
    overflow-y: auto;
}

.gamma50-list-expanded {
    max-height: 300px;
}

.gamma50-item {
    display: grid;
    grid-template-columns: 25px 1fr 60px 70px;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    font-size: 12px;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.gamma50-item:hover {
    background-color: #2a2a2a;
}

.gamma50-item:last-child {
    border-bottom: none;
}

.gamma50-rank {
    color: #666666;
    font-size: 11px;
    text-align: center;
}

.gamma50-symbol {
    font-weight: 600;
    color: #ffffff;
    font-size: 13px;
}

.gamma50-price {
    color: #888888;
    font-size: 11px;
    text-align: right;
}

.gamma50-exposure {
    font-weight: 600;
    font-size: 11px;
    text-align: right;
}

.gamma50-exposure.positive {
    color: #4ade80;
}

.gamma50-exposure.negative {
    color: #f87171;
}

.gamma50-show-more,
.gamma50-show-less {
    padding: 8px 12px;
    text-align: center;
    color: #4a9eff;
    font-size: 11px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.gamma50-show-more:hover,
.gamma50-show-less:hover {
    background-color: #2a2a2a;
    color: #6bb6ff;
}

/* Light Mode Gamma 50 Styles */
body.light-mode .gamma50-container {
    background: #ffffff;
    border: 1px solid #e0e0e0;
}

body.light-mode .gamma50-header {
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

body.light-mode .gamma50-title {
    color: #000000;
}

body.light-mode .gamma50-refresh {
    color: #666666;
}

body.light-mode .gamma50-refresh:hover {
    color: #000000;
}

body.light-mode .gamma50-loading {
    color: #666666;
}

body.light-mode .gamma50-error {
    color: #dc3545;
}

body.light-mode .gamma50-header-info {
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
}

body.light-mode .gamma50-updated {
    color: #666666;
}

body.light-mode .gamma50-count {
    color: #007bff;
}

body.light-mode .gamma50-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.light-mode .gamma50-item:hover {
    background-color: #f8f9fa;
}

body.light-mode .gamma50-rank {
    color: #999999;
}

body.light-mode .gamma50-symbol {
    color: #000000;
}

body.light-mode .gamma50-price {
    color: #666666;
}

body.light-mode .gamma50-exposure.positive {
    color: #28a745;
}

body.light-mode .gamma50-exposure.negative {
    color: #dc3545;
}

body.light-mode .gamma50-show-more,
body.light-mode .gamma50-show-less {
    color: #007bff;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

body.light-mode .gamma50-show-more:hover,
body.light-mode .gamma50-show-less:hover {
    background-color: #f8f9fa;
    color: #0056b3;
}

/* Mobile Responsive Adjustments for Gamma 50 */
@media (max-width: 768px) {
    .gamma50-container {
        font-size: 11px;
    }
    
    .gamma50-item {
        grid-template-columns: 20px 1fr 50px 60px;
        gap: 6px;
        padding: 5px 10px;
    }
    
    .gamma50-symbol {
        font-size: 12px;
    }
    
    .gamma50-price,
    .gamma50-exposure {
        font-size: 10px;
    }
    
    .gamma50-content {
        max-height: 200px;
    }
    
    .gamma50-list-expanded {
        max-height: 250px;
    }
}