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

body {
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #0e1117;
    color: #fafafa;
    padding: 1rem;
}

.container {
    max-width: 100%;
    margin: 0 auto;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid #262730;
    margin-bottom: 2rem;
}

.header-title {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #fafafa;
}

.notes-link {
    color: #a3a8b8;
    font-size: 0.95rem;
    text-decoration: none;
}

.notes-link:hover {
    color: #fafafa;
}

.notes-page {
    max-width: 860px;
}

.nse-page {
    max-width: 100%;
}

.nse-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid #262730;
    margin: 1.25rem 0 1rem;
}

.nse-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #a3a8b8;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.6rem 0.9rem;
    cursor: pointer;
}

.nse-tab.active {
    color: #fafafa;
    border-bottom-color: #ff4b4b;
}

.nse-meta {
    color: #a3a8b8;
    margin-bottom: 0.75rem;
}

.nse-pager {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.nse-error {
    color: #ff4b4b;
}

.notes-lead {
    color: #d0d4e0;
    line-height: 1.55;
    margin-bottom: 2rem;
}

.guide h2,
.release-list h2 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
}

.guide-section,
.release {
    background-color: #262730;
    border: 1px solid #3a3d4a;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.guide-section h3,
.release-head h3 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.guide-section p,
.release p,
.guide-section li,
.release li {
    color: #d0d4e0;
    line-height: 1.55;
    margin-bottom: 0.55rem;
}

.guide-section ul,
.release ul {
    margin: 0.25rem 0 0.25rem 1.25rem;
}

.release-head {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.65rem;
}

.release-head h3 {
    margin-bottom: 0;
}

.release-head time {
    color: #a3a8b8;
    font-size: 0.9rem;
}

.version-badge {
    color: #e6c200;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.release-list {
    margin-top: 2.5rem;
}

.controls {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #ff4b4b;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #ff6b6b;
}

.btn-danger {
    background-color: #262730;
    color: #fafafa;
    border: 1px solid #4b4b59;
}

.btn-danger:hover:not(:disabled) {
    background-color: #ff4b4b;
}

.btn-warning {
    background-color: #ffa726;
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background-color: #fb8c00;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Status Bar */
.status-bar {
    display: flex;
    gap: 2rem;
    padding: 1rem;
    background-color: #262730;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.status-info {
    display: flex;
    gap: 0.5rem;
}

.status-label {
    font-weight: 600;
    color: #a3a8b8;
}

.status-value {
    color: #fafafa;
}

/* OTP Container */
.otp-container {
    margin-bottom: 1.5rem;
}

.otp-box {
    background-color: #262730;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 2px solid #ff4b4b;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.otp-box label {
    font-weight: 600;
    color: #fafafa;
}

.otp-box input {
    flex: 0 0 150px;
    padding: 0.5rem;
    border: 1px solid #4b4b59;
    border-radius: 0.25rem;
    background-color: #0e1117;
    color: #fafafa;
    font-size: 1rem;
}

.otp-box input:focus {
    outline: none;
    border-color: #ff4b4b;
}

/* Error Container */
.error-container {
    margin-bottom: 1.5rem;
}

.error-box {
    background-color: #3d1f1f;
    border: 1px solid #ff4b4b;
    padding: 1rem;
    border-radius: 0.5rem;
    color: #fafafa;
}

.error-box strong {
    color: #ff4b4b;
}

.iv-halt-container {
    margin-bottom: 1.5rem;
}

.iv-halt-box {
    background-color: #3d3018;
    border: 1px solid #e6a817;
    padding: 1rem;
    border-radius: 0.5rem;
    color: #fafafa;
}

.iv-halt-box strong {
    color: #e6a817;
}

/* Config Container */
.config-container {
    margin-bottom: 1.5rem;
}

.config-box {
    background-color: #262730;
    padding: 1.5rem;
    border-radius: 0.5rem;
}

.config-box h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #fafafa;
}

.config-field {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.config-field label {
    font-weight: 600;
    color: #a3a8b8;
}

.config-field input {
    padding: 0.5rem;
    border: 1px solid #4b4b59;
    border-radius: 0.25rem;
    background-color: #0e1117;
    color: #fafafa;
    font-size: 1rem;
    max-width: 300px;
}

.config-field input:focus {
    outline: none;
    border-color: #ff4b4b;
}

/* Logs Section */
.logs-section {
    margin-bottom: 2rem;
}

.logs-section h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #a3a8b8;
}

.logs-box {
    background-color: #262730;
    padding: 1rem;
    border-radius: 0.5rem;
    height: 150px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}

.log-entry {
    margin-bottom: 0.25rem;
    color: #a3a8b8;
}

/* Tabs */
.tabs-container {
    margin-top: 2rem;
}

.smart-money {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fafafa;
}

.tab-smart-money.is-flashing {
    animation: smart-money-flash 1s linear infinite;
    border-radius: 0.2rem;
    padding: 0.05rem 0.35rem;
}

@keyframes smart-money-flash {
    0%,
    49.9% {
        background-color: #fff;
        color: #000;
    }
    50%,
    100% {
        background-color: #000;
        color: #fff;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tab-smart-money.is-flashing {
        animation: none;
        background-color: #fff;
        color: #000;
    }
}

td.smart-money-mark.nifty-positive {
    box-shadow: inset 0 0 0 2px #4caf50;
}

td.smart-money-mark.nifty-negative {
    box-shadow: inset 0 0 0 2px #ff4b4b;
}

.tabs-header {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid #262730;
    margin-bottom: 1rem;
    overflow-x: auto;
}

.tab-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.65rem 1.1rem 0.5rem;
    background-color: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #a3a8b8;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    white-space: nowrap;
    line-height: 1.2;
}

.tab-strike {
    color: #a3a8b8;
}

.tab-button:hover .tab-strike {
    color: #fafafa;
}

.tab-button.active {
    border-bottom-color: #ff4b4b;
}

.tab-button.active .tab-strike {
    color: #ff4b4b;
}

.tab-smart-money {
    font-size: 0.72rem;
    font-weight: 600;
    color: #6b7080;
}

.tab-smart-money.has-marks {
    color: #fafafa;
}

.tab-signals {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    min-height: 0;
    font-size: 0.72rem;
    font-weight: 600;
}

.tab-signal.neutral {
    color: #e6c200;
}

.tab-signal.bearish {
    color: #ff4b4b;
}

.tab-signal.bullish {
    color: #4caf50;
}

.signal-panel {
    background-color: #262730;
    border: 1px solid #3a3d4a;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.signal-panel-head {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}

.signal-strike {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fafafa;
}

.signal-neutral.yes {
    color: #e6c200;
    font-weight: 600;
}

.signal-neutral.no,
.signal-gap {
    color: #a3a8b8;
}

.signal-contracts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.signal-contract {
    background-color: #1e1e2a;
    border: 1px solid #3a3d4a;
    border-radius: 0.4rem;
    padding: 0.75rem 1rem;
}

.signal-contract.bearish {
    border-color: #ff4b4b;
}

.signal-contract.bullish {
    border-color: #4caf50;
}

.signal-contract-name {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #a3a8b8;
}

.signal-contract-trend {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0.2rem 0;
}

.signal-contract.bearish .signal-contract-trend {
    color: #ff4b4b;
}

.signal-contract.bullish .signal-contract-trend {
    color: #4caf50;
}

.signal-contract.none .signal-contract-trend {
    color: #a3a8b8;
}

.signal-contract-pct {
    color: #d0d4e0;
}

.signal-first {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 0.75rem;
    color: #a3a8b8;
    font-size: 0.85rem;
}

.tab-button.highest-oi-call {
    background-color: rgba(255, 75, 75, 0.2);
}

.tab-button.highest-oi-put {
    background-color: rgba(76, 175, 80, 0.2);
}

.tab-button.second-oi-call {
    border: 2px solid rgba(255, 75, 75, 0.6);
    border-bottom-width: 2px;
}

.tab-button.second-oi-put {
    border: 2px solid rgba(76, 175, 80, 0.6);
    border-bottom-width: 2px;
}

.tab-button.third-oi-call {
    border: 2px dashed rgba(255, 75, 75, 0.6);
    border-bottom-width: 2px;
}

.tab-button.third-oi-put {
    border: 2px dashed rgba(76, 175, 80, 0.6);
    border-bottom-width: 2px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Tables */
.table-section {
    margin-bottom: 2rem;
}

.table-section h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #a3a8b8;
}

/* Table wrapper for scrolling */
.table-wrapper {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: auto;
    border-radius: 0.5rem;
    background-color: #262730;
    position: relative;
    display: block;
    /* Prevent scroll jumping */
    overflow-anchor: none;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #262730;
    position: relative;
}

.data-table thead {
    background-color: #1e2129;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table thead tr {
    display: table-row;
}

.data-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #fafafa;
    border-bottom: 1px solid #0e1117;
    font-size: 0.85rem;
    background-color: #1e2129;
    position: sticky;
    top: 0;
}

/* Frozen rows (first 2 rows of ROC table) */
.data-table tbody tr.frozen-row-1 {
    position: sticky;
    top: 41px; /* Height of thead */
    z-index: 9;
    background-color: #2d3748;
}

.data-table tbody tr.frozen-row-1 td {
    position: relative;
    background-color: #2d3748;
}

.data-table tbody tr.frozen-row-2 {
    position: sticky;
    top: 82px; /* Height of thead + first row */
    z-index: 8;
    background-color: #2d3748;
}

.data-table tbody tr.frozen-row-2 td {
    position: relative;
    background-color: #2d3748;
}

.data-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #1e2129;
    font-size: 0.85rem;
    color: #fafafa;
}

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

/* Value styling */
.positive {
    background-color: darkgreen !important;
    color: white !important;
}

.negative {
    background-color: red !important;
    color: white !important;
}

.neutral {
    color: #a3a8b8;
}

/* Percentage text styling */
.percentage {
    font-size: 0.75rem;
    color: #a3a8b8;
    font-weight: normal;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0e1117;
}

::-webkit-scrollbar-thumb {
    background: #4b4b59;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5b5b69;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .status-bar {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .otp-box {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .otp-box input {
        width: 100%;
    }
}

/* Top 3 OI Summary */
.top3-summary {
    background-color: #1a1d28;
    border: 1px solid #262730;
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
}

.top3-header {
    font-size: 0.9rem;
    color: #a3a8b8;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.top3-entry {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
    font-size: 0.85rem;
}

.top3-entry {
    background-color: rgba(163, 168, 184, 0.15);
    color: #fafafa;
}

.top3-entry small {
    font-weight: 400;
    opacity: 0.8;
}

.top3-sides {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.top3-side {
    background-color: #262730;
    border-radius: 0.4rem;
    padding: 0.85rem 1rem;
    border: 1px solid #3a3d4a;
}

.top3-side.remark-bearish {
    background-color: #3d1f1f;
    border-color: #ff4b4b;
}

.top3-side.remark-bullish {
    background-color: #1e3d24;
    border-color: #4caf50;
}

.top3-side-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #a3a8b8;
    margin-bottom: 0.6rem;
}

.top3-metrics {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.metric-label {
    font-size: 0.75rem;
    color: #a3a8b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 1.15rem;
    font-weight: 600;
    color: #fafafa;
}

.top3-remark {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fafafa;
}

.strike-money-flow {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    background-color: #1a1d28;
    border: 1px solid #262730;
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
}

.money-flow-section h4 {
    color: #90caf9 !important;
}

@media (max-width: 768px) {
    .top3-sides {
        grid-template-columns: 1fr;
    }
}

/* Loading animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s ease-in-out infinite;
}

