/* Theme Variables */
:root {
    /* Default Theme - Coral Rush (current) */
    --primary-color: #ea580c;
    --primary-hover: #c2410c;
    --primary-light: #fed7aa;
    --primary-dark: #9a3412;
    --primary-accent: #f97316;
    --badge-color: #c2410c;
    
    /* These remain constant across themes */
    --success-green: #10b981;
    --success-green-hover: #059669;
    --success-green-light: #d1fae5;
    --success-green-border: #86efac;
    --success-green-text: #065f46;
    
    --error-red: #ef4444;
    --error-red-hover: #dc2626;
    --error-red-light: #fee2e2;
    --error-red-text: #991b1b;
    
    --info-blue: #3b82f6;
    --gray-bg: #f3f4f6;
    --gray-light: #f9fafb;
    --gray-border: #e5e7eb;
    --gray-input: #d1d5db;
    --gray-cancel: #9ca3af;
    --gray-text: #6b7280;
    --gray-button-hover: #4b5563;
    --gray-dark: #374151;
    --gray-heading: #1f2937;
    --white: #ffffff;
    --chart-indigo: #6366f1;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: #f3f4f6;
    min-height: 100vh;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem;
}

.card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.flex {
    display: flex;
}

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

.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

h1 {
    font-size: 1.875rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

h3 {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.subtitle {
    color: #6b7280;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-green {
    background-color: #10b981;
    color: white;
}

.btn-green:hover {
    background-color: #059669;
}

.btn-red {
    background-color: #ef4444;
    color: white;
}

.btn-red:hover {
    background-color: #dc2626;
}

.btn-purple {
    background-color: var(--primary-color);
    color: white;
}

.btn-purple:hover {
    background-color: var(--primary-hover);
}

.btn-gray {
    background-color: #6b7280;
    color: white;
}

.btn-gray:hover {
    background-color: #4b5563;
}

.btn-cancel {
    background-color: #d1d5db;
    color: #374151;
}

.btn-cancel:hover {
    background-color: #9ca3af;
}

.select {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
}

.input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    font-size: 1rem;
}

.input[readonly] {
    background-color: #f3f4f6;
}

.label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.text-2xl {
    font-size: 1.5rem;
    font-weight: bold;
}

.text-green {
    color: #10b981;
}

.text-red {
    color: #ef4444;
}

.text-blue {
    color: #3b82f6;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-gray {
    color: #6b7280;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.p-3 {
    padding: 0.75rem;
}

.p-4 {
    padding: 1rem;
}

.bg-gray-light {
    background-color: #f9fafb;
}

.bg-green-light {
    background-color: #d1fae5;
}

.bg-purple-light {
    background-color: var(--primary-light);
}

.bg-red-light {
    background-color: #fee2e2;
}

.rounded {
    border-radius: 0.5rem;
}

.border-2 {
    border-width: 2px;
}

.border-green {
    border-color: #86efac;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-green {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-red {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-blue {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-purple {
    background-color: #e9d5ff;
    color: #7c3aed;
}

.badge-gray {
    background-color: #f3f4f6;
    color: #374151;
}

.badge-count {
    background-color: var(--badge-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
}

td {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
}

.hidden {
    display: none;
}

.trade-form {
    background-color: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1.5rem;
}

.icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
}

.icon-large {
    width: 32px;
    height: 32px;
}

.chart-container {
    overflow-x: auto;
    min-height: 320px;
    height: auto;
}

.chart-container svg {
    width: 100%;
    height: auto;
    min-height: 320px;
    display: block;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 0.25rem;
}

.position-summary {
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.text-purple {
    color: var(--primary-hover);
}

.text-gray-dark {
    color: #374151;
}

.opacity-75 {
    opacity: 0.75;
}

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

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

/* Market Movers Card Styles */
.market-mover-card {
    background: white;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    padding: 1rem;
    transition: all 0.2s;
}

.market-mover-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.market-mover-card.gainer {
    border-left: 4px solid #10b981;
}

.market-mover-card.loser {
    border-left: 4px solid #ef4444;
}

.market-mover-card.ipo {
    border-left: 4px solid #3b82f6;
}

/* Today's IPO highlighting */
.today-ipo {
    background-color: #fef3c7 !important; /* Light amber */
}

.market-mover-card.today-ipo {
    background-color: #fef3c7;
    border: 1px solid #fbbf24;
    border-left: 4px solid #f59e0b;
}

/* Past IPOs - Already Trading */
.past-ipo {
    background-color: #f0fdf4 !important; /* Light green tint */
}

.market-mover-card.past-ipo {
    background-color: #f0fdf4;
    border: 1px solid #86efac;
    border-left: 4px solid #10b981;
}

/* Future IPOs - Not Yet Trading */
.future-ipo {
    background-color: #eff6ff !important; /* Light blue tint */
}

.market-mover-card.future-ipo {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 4px solid #3b82f6;
}

/* Clickable stock ticker styles */
.clickable-ticker {
    cursor: pointer;
    color: var(--primary-color);
    transition: all 0.2s;
}

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

.lg-grid-cols-3 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .container {
        width: 90%;
        padding: 1rem 0; /* Remove horizontal padding on larger screens */
    }

    .md-grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .md-grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .md-grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .lg-grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Live price indicator animation */
@keyframes livePriceBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Options Page Specific Styles */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

#optionsContent .card table td {
  padding-top: 4px;
  padding-bottom: 4px;
}

#optionsContent .card table td:first-child {
  padding-left: 12px;
}

#optionsContent .card table td:last-child {
  padding-right: 12px;
}

.atm-row-highlight td {
  background-color: rgba(59, 130, 246, 0.1);
}

/* Style for user-clicked row highlight */
.user-selected-row td {
  background-color: #ffe0e5; /* Pastel Pink */
} 

/* Strike Zone Styles */
.card.strike-zone-buy {
    animation: glowPulseBuy 2s ease-in-out infinite;
}

.card.strike-zone-sell {
    animation: glowPulseSell 2s ease-in-out infinite;
}

/* Higher specificity combo rules for loaded cards in strike zones */
.card.card-loaded.strike-zone-buy {
    animation: fadeInCard 0.25s ease forwards,
               glowPulseBuy 2s ease-in-out 0.25s infinite;
}

.card.card-loaded.strike-zone-sell {
    animation: fadeInCard 0.25s ease forwards,
               glowPulseSell 2s ease-in-out 0.25s infinite;
}

/* Ensure timer urgency glow survives card-loaded animation */
.card.card-loaded.timer-close-orange {
    animation: fadeInCard 0.25s ease forwards,
               orangePulse 2s ease-in-out 0.25s infinite;
}

.card.card-loaded.timer-overdue-black {
    animation: fadeInCard 0.25s ease forwards,
               blackPulse 3s ease-in-out 0.25s infinite;
}

@keyframes glowPulseBuy {
    0%, 100% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.3), 
                    0 0 40px rgba(16, 185, 129, 0.2),
                    inset 0 0 20px rgba(16, 185, 129, 0.1);
    }
    50% {
        box-shadow: 0 0 30px rgba(16, 185, 129, 0.5), 
                    0 0 60px rgba(16, 185, 129, 0.3),
                    inset 0 0 30px rgba(16, 185, 129, 0.15);
    }
}

@keyframes glowPulseSell {
    0%, 100% {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.3),
                    0 0 40px rgba(239, 68, 68, 0.2),
                    inset 0 0 20px rgba(239, 68, 68, 0.1);
    }
    50% {
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.5),
                    0 0 60px rgba(239, 68, 68, 0.3),
                    inset 0 0 30px rgba(239, 68, 68, 0.15);
    }
}

/* Timer Styles */
.timer-close-orange {
    animation: orangePulse 2s ease-in-out infinite;
}

.timer-overdue-black {
    animation: blackPulse 3s ease-in-out infinite;
}

@keyframes orangePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(251, 146, 60, 0);
    }
    50% {
        box-shadow: 0 0 20px 5px rgba(251, 146, 60, 0.3),
                    inset 0 0 15px rgba(251, 146, 60, 0.1);
    }
}

@keyframes blackPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
    }
    50% {
        box-shadow: 0 0 15px 3px rgba(0, 0, 0, 0.2),
                    inset 0 0 10px rgba(0, 0, 0, 0.1);
    }
}

/* Timer button styling */
.btn-timer {
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    width: 28px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-timer:hover {
    background: #f3f4f6;
    border-color: #000000;
}

.btn-timer.confirm-remove {
    animation: jiggleAndBlink 0.5s ease-in-out infinite;
    border-color: #ef4444 !important;
    background-color: rgba(239, 68, 68, 0.1) !important;
}

@keyframes jiggleAndBlink {
    0%, 100% {
        transform: rotate(0deg);
        opacity: 1;
    }
    25% {
        transform: rotate(-3deg);
        opacity: 0.7;
    }
    50% {
        transform: rotate(3deg);
        opacity: 1;
    }
    75% {
        transform: rotate(-3deg);
        opacity: 0.7;
    }
}

/* Timer display text colors */
.timer-display {
    font-size: 0.85rem;
    font-weight: 500;
    margin-right: 8px;
}

.timer-display.timer-approaching {
    color: #000000;
}

.timer-display.timer-close {
    color: #fb923c;
    font-weight: 600;
}

.timer-display.timer-today {
    color: #fb923c;
    font-weight: 700;
}

.timer-display.timer-overdue {
    color: #000000;
    text-decoration: line-through;
}

/* Timer modal styling */
.timer-mode-option:hover {
    border-color: #000000 !important;
    background-color: #f3f4f6;
}

.timer-mode-option input[type="radio"]:checked + div {
    color: #000000;
}

/* Zone management buttons */

.card.card-loading {
    position: relative;
}

.card.card-loading .chart-container {
    position: relative;
    overflow: hidden;
}

.card.card-loading .chart-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        var(--primary-light) 25%,
        var(--primary-accent) 50%,
        var(--primary-light) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.card.card-loading svg {
    opacity: 0;
}

.card.card-loaded {
    animation: fadeInScale 0.4s ease-out;
}

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

@keyframes fadeInCard {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.watchlist-status {
    display: none;
    margin-top: 0.75rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.watchlist-status.visible {
    display: flex;
}

.watchlist-status .status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    background: #f3f4f6;
    color: #4b5563;
}

.status-chip.status-error {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

.status-chip.status-loading {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

.btn-refresh-failed {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 0.2rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #1f2937;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-refresh-failed:hover {
    border-color: #2563eb;
    color: #2563eb;
}
.btn-zone-remove {
    background: transparent;
    border: 1px solid;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-zone-remove.buy-zone {
    color: #10b981;
    border-color: #10b981;
}

.btn-zone-remove.buy-zone:hover {
    background: #10b981;
    color: white;
}

.btn-zone-remove.sell-zone {
    color: #ef4444;
    border-color: #ef4444;
}

.btn-zone-remove.sell-zone:hover {
    background: #ef4444;
    color: white;
}

/* Zone drawing cursor */
.chart-container.drawing-zone {
    cursor: crosshair;
}

/* Zone rectangles on charts */
.strike-zone-rect {
    pointer-events: none;
}

/* Strike zone label interactions */
.strike-zone-label {
    font-size: 11px;
    font-weight: 600;
    cursor: grab;
    user-select: none;
}

.strike-zone-label:hover {
    font-size: 13px;
    font-weight: 700;
}

.strike-zone-label.dragging {
    cursor: grabbing;
    font-size: 14px;
    font-weight: 800;
}

/* Off-chart zone indicators */
.zone-overflow-indicator {
    font-size: 10px;
    font-weight: bold;
}

.zone-overflow-gradient-top {
    pointer-events: none;
}

.zone-overflow-gradient-bottom {
    pointer-events: none;
} 
/* Modal Styles */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    min-width: 400px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

/* Ticker grid for modal */
.ticker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ticker-button {
    padding: 0.75rem 1rem;
    background: var(--gray-light);
    border: 1px solid var(--gray-border);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-weight: 500;
}

.ticker-button:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-dark);
}

/* Enhanced Stock Bar Styles */
.enhanced-stock-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.stock-tags-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    flex: 1;
}

.stock-bar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.current-price-display {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Stock Tag Styles */
.stock-tag {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    user-select: none;
}

/* Position tags (purple) */
.stock-tag-position {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.stock-tag-position:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Watchlist tags (blue) */
.stock-tag-watchlist {
    background-color: #dbeafe;
    color: #1e40af;
}

.stock-tag-watchlist:hover {
    background-color: #3b82f6;
    color: white;
}

/* Active/selected tag */
.stock-tag-active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.1);
}

/* More button */
.stock-tag-more {
    background-color: #f3f4f6;
    color: #6b7280;
    font-style: italic;
}

.stock-tag-more:hover {
    background-color: #e5e7eb;
    color: #374151;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .enhanced-stock-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stock-bar-right {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }
    
    .current-price-display {
        align-items: flex-start;
    }
}

/* Modal Overlay - Critical for welcome modal display */
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 9999 !important;
}

.modal-overlay.hidden {
    display: none !important;
}

/* Welcome Modal - Ensure it's always above loading overlay */
#welcomeModal {
    z-index: 10001 !important;
}

/* Ensure modal content within overlay displays properly */
.modal-overlay .modal-content {
    position: relative !important;
    max-width: 600px !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
    background: white !important;
    padding: 2rem !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}

.option-premium-modal {
    position: relative;
    max-width: 720px;
    width: min(92vw, 720px);
}

.modal-close-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #9ca3af;
    padding: 0.25rem;
    transition: color 0.2s ease;
}

.modal-close-btn:hover {
    color: #4b5563;
}

.modal-subtitle {
    color: var(--gray-text);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.modal-meta {
    color: var(--gray-dark);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.modal-range-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.btn-period {
    padding: 0.35rem 0.9rem;
    font-size: 0.9rem;
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid transparent;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-period:hover {
    background: #e5e7eb;
}

.btn-period.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.modal-status {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    color: var(--gray-text);
}

.modal-status.error {
    color: var(--error-red);
}

.modal-chart-container {
    min-height: 280px;
    background: var(--gray-light);
    border-radius: 0.375rem;
    border: 1px solid var(--gray-border);
    padding: 0.5rem;
}

#optionPremiumChart {
    width: 100%;
    height: 320px;
}

/* Welcome Modal Styles */
.welcome-section {
    margin-bottom: 1rem;
}

.welcome-stocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.welcome-stock-item {
    padding: 0.75rem;
    border: 1px solid var(--gray-border);
    border-radius: 0.5rem;
    background: var(--gray-light);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.welcome-stock-item:hover {
    background: var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.welcome-stock-item input[type="checkbox"] {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

.welcome-stock-ticker {
    font-weight: bold;
    font-size: 1rem;
    color: var(--gray-heading);
    margin-bottom: 0.25rem;
}

.welcome-stock-change {
    font-size: 0.875rem;
    font-weight: 500;
}

.welcome-stock-change.positive {
    color: var(--success-green);
}

.welcome-stock-change.negative {
    color: var(--error-red);
}

.welcome-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.welcome-category {
    border: 1px solid var(--gray-border);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.2s ease;
}

.welcome-category:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.welcome-category-label {
    display: flex;
    align-items: center;
    padding: 1rem;
    cursor: pointer;
    background: var(--gray-light);
    transition: background 0.2s ease;
}

.welcome-category-label:hover {
    background: var(--white);
}

.welcome-category-checkbox {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.welcome-category-checkbox:checked + .welcome-category-content {
    color: var(--primary-color);
}

.welcome-category-content {
    flex: 1;
}

.welcome-category-content strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--gray-heading);
}

.welcome-category-content small {
    color: var(--gray-text);
    font-size: 0.8rem;
}

/* Loading state for gainers */
.loading-message {
    text-align: center;
    padding: 2rem;
    color: var(--gray-text);
}

/* Mobile responsiveness for welcome modal */
@media (max-width: 768px) {
    .welcome-stocks-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .welcome-categories {
        grid-template-columns: 1fr;
    }
}

/* Save Indicator Animation */
.save-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.save-indicator svg {
    fill: white;
    width: 20px;
    height: 20px;
}

.save-indicator.show {
    animation: saveAnimation 1.5s ease-out;
}

@keyframes saveAnimation {
    0% {
        opacity: 0;
        transform: scale(0.8) rotate(0deg);
    }
    15% {
        opacity: 1;
        transform: scale(1.15) rotate(5deg);
    }
    30% {
        transform: scale(0.95) rotate(-3deg);
    }
    40% {
        transform: scale(1.05) rotate(2deg);
    }
    50% {
        transform: scale(1) rotate(0deg);
        /* Glint effect */
        box-shadow: 0 0 25px rgba(76, 175, 80, 0.9),
                    0 0 50px rgba(76, 175, 80, 0.5),
                    0 2px 8px rgba(0, 0, 0, 0.2);
    }
    60% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: scale(0.9) rotate(0deg);
    }
}

/* Add a subtle glint/shine effect on the icon itself */
@keyframes glint {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}

.save-indicator.show::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, transparent 70%);
    border-radius: 50%;
    animation: glint 1.5s ease-out;
}

/* Volume display transitions */
.volume-transition {
    transition: all 0.3s ease;
}

/* Volume Display System */

.volume-cell {
    position: relative;
    perspective: 700px;
    cursor: pointer;
    display: block;
    width: 100%;
}

.volume-card {
    position: relative;
    width: 100%;
    transform-style: preserve-3d;
    transition: transform 0.45s ease;
}

.volume-cell:hover,
.volume-cell:focus,
.volume-cell:focus-within {
    z-index: 9999 !important;
    position: relative;
}

.volume-cell:hover .volume-card,
.volume-cell:focus .volume-card,
.volume-cell:focus-within .volume-card {
    transform: rotateY(180deg);
    z-index: 9999 !important;
}

.volume-cell:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.volume-face {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 4px;
    backface-visibility: hidden;
}

.volume-front {
    gap: 2px;
}

.volume-back {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    padding: 12px;
    background: var(--white);
    border: 2px solid var(--gray-border);
    border-radius: 8px;
    gap: 10px;
    transform: rotateY(180deg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    z-index: 9999;
}

.volume-value {
    font-weight: 600;
    color: var(--gray-heading);
    font-size: 1rem;
}

.volume-back .volume-value {
    color: var(--gray-heading);
}

.volume-metric {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.volume-metric-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.volume-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--gray-text);
}

.volume-back .volume-label {
    color: var(--gray-text);
    opacity: 0.9;
}

/* Upward flipping volume cards for bottom rows */
.volume-flip-upward .volume-back {
    top: auto;
    bottom: 100%;
    margin-bottom: 10px;
}

.volume-flip-upward:hover,
.volume-flip-upward:focus,
.volume-flip-upward:focus-within {
    z-index: 10000 !important;
}

.volume-flip-upward:hover .volume-card,
.volume-flip-upward:focus .volume-card,
.volume-flip-upward:focus-within .volume-card {
    z-index: 10000 !important;
}

/* Market movers table wrapper - allow overflow for flip cards */
.market-movers-table-wrapper {
    overflow: visible;
    position: relative;
}

.volume-relative {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.volume-raw {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-heading);
}

.volume-raw-main {
    font-weight: 700;
}

.volume-back .volume-raw {
    color: var(--gray-heading);
}

/* Raw detail styles removed - no longer showing redundant numbers */

.volume-back-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.volume-back-divider {
    width: 100%;
    height: 1px;
    background: rgba(15, 23, 42, 0.08);
}

.volume-back .volume-back-divider {
    background: rgba(58, 41, 20, 0.18);
}

.volume-relative.positive {
    color: var(--success-green);
    background-color: var(--success-green-light);
}

.volume-relative.negative {
    color: var(--error-red);
    background-color: var(--error-red-light);
}

.volume-relative.neutral {
    color: var(--gray-text);
    background-color: var(--gray-bg);
}

/* Volume Help Icon */
.volume-help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 4px;
    background-color: var(--info-blue);
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.volume-help-icon:hover {
    background-color: var(--primary-color);
}

/* Tooltip removed in favor of flip-card interaction */

/* Volume Shimmer Loading Animation */
.volume-shimmer {
    background: linear-gradient(
        90deg,
        var(--primary-light) 25%,
        var(--primary-accent) 50%,
        var(--primary-light) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite ease-in-out;
    border-radius: 4px;
    min-height: 24px;
    width: 100%;
    position: relative;
}

/* Shimmer keyframe animation */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Volume data loaded animation */
.volume-loaded {
    animation: fadeInScale 0.4s ease-out;
}

/* Smooth fade-in when data loads */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Volume shimmer placeholder bars for metrics */
.volume-shimmer-bar {
    background: linear-gradient(
        90deg,
        var(--primary-light) 25%,
        var(--primary-accent) 50%,
        var(--primary-light) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite ease-in-out;
    border-radius: 3px;
    height: 16px;
    margin: 2px 0;
}

/* Different shimmer bar widths for visual variety */
.volume-shimmer-bar.short {
    width: 60%;
}

.volume-shimmer-bar.medium {
    width: 80%;
}

.volume-shimmer-bar.long {
    width: 100%;
}

/* Watchlist Price Heading Shimmer */
.watchlist-price-shimmer {
    display: inline-block;
    width: 85px;
    height: 20px;
    margin-left: 8px;
    vertical-align: middle;
    background: linear-gradient(
        90deg,
        var(--primary-light) 25%,
        var(--primary-accent) 50%,
        var(--primary-light) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite ease-in-out;
    border-radius: 3px;
}

/* Smooth fade-in when price data loads */
.watchlist-price-loaded {
    animation: fadeInScale 0.4s ease-out;
}

/* Volume cards within market mover cards need wider flip-over area */
.market-mover-card .volume-back {
    /* Increase horizontal extension for better content fit */
    left: -20px;
    right: -20px;
    /* Add min-width to ensure content fits */
    min-width: 200px;
}

/* On smaller screens, adjust further if needed */
@media (max-width: 768px) {
    .market-mover-card .volume-back {
        left: -15px;
        right: -15px;
        min-width: 180px;
    }
}

/* Auto-refresh indicator animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.refresh-icon.spinning {
    animation: spin 1s linear;
}

/* Refresh status indicator (non-interactive) */
.refresh-status-indicator {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    cursor: default;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.refresh-status-indicator .icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text-color);
}

.refresh-status-indicator.refreshing {
    opacity: 1;
}

.refresh-status-indicator.refreshing .refresh-icon {
    filter: drop-shadow(0 0 8px var(--primary-color));
}

.refresh-status-indicator.hidden {
    display: none;
}

#autoRefreshIndicator {
    position: relative;
}

/* Refresh Countdown Indicator (Pie Chart + Spinner) */
.refresh-countdown-indicator {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0.25rem;
    cursor: default;
}

.refresh-countdown-indicator.hidden {
    display: none;
}

/* SVG Pie Chart */
.countdown-pie {
    width: 100%;
    height: 100%;
    transform: rotate(0deg);
}

/* Background circle (light gray) */
.countdown-bg {
    stroke: #e5e7eb;
    stroke-width: 2;
}

/* Progress circle (darkened theme color) */
.countdown-progress {
    stroke: var(--primary-color);
    filter: brightness(0.7); /* Darken by 30% */
    stroke-width: 2;
    transition: stroke-dasharray 0.1s linear;
}

.countdown-progress.hidden {
    display: none;
}

/* Spinner (shown during refresh) */
.refresh-countdown-indicator .spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.25rem;
    color: var(--primary-color);
}

.refresh-countdown-indicator .spinner.hidden {
    display: none;
}

.refresh-countdown-indicator .spinner.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Earnings Date Styling */
.earnings-info {
    margin-top: 8px;
    padding-left: 4px;
    font-size: 0.9rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
}

.earnings-info span {
    display: inline-flex;
    align-items: center;
}

/* Earnings urgency styling */
.earnings-urgent {
    color: #dc2626 !important; /* Red for <= 7 days */
    font-weight: 600;
}

.earnings-soon {
    color: #f59e0b !important; /* Amber for <= 14 days */
    font-weight: 500;
}

/* Dark mode support for earnings */
[data-theme*="dark"] .earnings-info,
[data-theme*="neon"] .earnings-info,
[data-theme*="midnight"] .earnings-info {
    color: #9ca3af;
}

[data-theme*="dark"] .earnings-urgent,
[data-theme*="neon"] .earnings-urgent,
[data-theme*="midnight"] .earnings-urgent {
    color: #ef4444 !important;
}

[data-theme*="dark"] .earnings-soon,
[data-theme*="neon"] .earnings-soon,
[data-theme*="midnight"] .earnings-soon {
    color: #fbbf24 !important;
}

/* Hover effect for earnings info */
.card:hover .earnings-info {
    color: var(--primary-color);
}

.card:hover .earnings-urgent {
    color: #dc2626 !important;
}

.card:hover .earnings-soon {
    color: #f59e0b !important;
}

/* ============================================
   POSITION SETTINGS MODAL STYLES
   ============================================ */

/* Settings Tag Chips */
.settings-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 0.375rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.settings-tag-chip .tag-remove {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: color 0.2s;
}

.settings-tag-chip .tag-remove:hover {
    color: var(--error-red);
}

/* Suggested Tags */
.suggested-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.settings-tag-suggested {
    background: var(--gray-light);
    border: 1px solid var(--gray-border);
    color: var(--gray-dark);
    padding: 0.375rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.settings-tag-suggested:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-dark);
}

/* Alert Cards */
.settings-alert-card {
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.alert-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.alert-card-header input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.alert-card-body {
    margin-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.alert-card-actions {
    margin-left: 1.5rem;
}

.alert-enabled-checkbox {
    cursor: pointer;
}

/* Button Size Variants */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Portfolio Settings Button */
.btn-portfolio-settings {
    background: transparent;
    border: 1px solid var(--gray-border);
    border-radius: 4px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.btn-portfolio-settings:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    transform: rotate(45deg);
}

/* ============================================
   FORCED TIMER REVIEW MODAL STYLES
   ============================================ */

/* Blocking modal overlay - cannot be dismissed */
.modal-blocking {
    z-index: 99999 !important;
    background-color: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(8px);
}

/* Prevent clicking outside to close */
.modal-blocking .modal-content {
    pointer-events: auto;
}

/* Timer Review Modal Container */
.timer-review-modal {
    animation: timerReviewSlideIn 0.4s ease-out;
}

@keyframes timerReviewSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Header Section */
.timer-review-header {
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-border);
    margin-bottom: 1.5rem;
}

.timer-review-header h2 {
    animation: urgentPulse 2s ease-in-out infinite;
}

@keyframes urgentPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Timer Details Section */
.timer-review-details {
    background: var(--gray-light);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.timer-review-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-border);
}

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

.timer-review-label {
    font-weight: 600;
    color: var(--gray-text);
    font-size: 0.875rem;
}

.timer-review-value {
    font-weight: 500;
    color: var(--gray-heading);
}

.timer-review-status {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.875rem;
}

.timer-review-status.status-overdue {
    background: var(--error-red-light);
    color: var(--error-red-text);
}

.timer-review-status.status-today {
    background: #fed7aa;
    color: #9a3412;
}

/* Actions Section */
.timer-review-actions {
    margin-bottom: 1rem;
}

.timer-review-action-card {
    background: white;
    border: 2px solid var(--gray-border);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.timer-review-action-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.action-card-header {
    margin-bottom: 0.5rem;
}

.action-card-header strong {
    display: block;
    font-size: 1rem;
    color: var(--gray-heading);
    margin-bottom: 0.25rem;
}

.action-card-header small {
    color: var(--gray-text);
    font-size: 0.75rem;
}

.action-card-body {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-card-body .btn {
    flex-shrink: 0;
}

/* Blocking Notice */
.timer-review-notice {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-border);
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .timer-review-modal {
        max-width: 95% !important;
        margin: 0 auto;
    }

    .action-card-body {
        flex-direction: column;
        align-items: stretch;
    }

    .action-card-body .input {
        width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 0.5rem;
    }

    .action-card-body .btn {
        width: 100%;
    }
}
