:root {
    /* Light Theme Colors */
    --bg-primary: #f8f9fb;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f2f5;
    --text-primary: #0f1419;
    --text-secondary: #5b6572;
    --text-tertiary: #8b95a1;
    --border-color: #e1e4e8;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    
    /* Accent Colors */
    --accent-primary: #2563eb;
    --accent-secondary: #3b82f6;
    --bullish: #10b981;
    --bullish-light: #d1fae5;
    --bullish-dark: #047857;
    --bearish: #ef4444;
    --bearish-light: #fee2e2;
    --bearish-dark: #dc2626;
    --neutral: #f59e0b;
    --neutral-light: #fef3c7;
    
    /* Gradients */
    --gradient-bullish: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-bearish: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --gradient-neutral: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-card: linear-gradient(135deg, #ffffff 0%, #f8f9fb 100%);
    
    /* Typography */
    --font-display: 'Outfit', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f28;
    --bg-tertiary: #252b36;
    --text-primary: #f8f9fb;
    --text-secondary: #b8bec8;
    --text-tertiary: #8b95a1;
    --border-color: #2d3340;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --gradient-card: linear-gradient(135deg, #1a1f28 0%, #252b36 100%);
}

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

body {
    font-family: var(--font-display);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background var(--transition-base), color var(--transition-base);
    overflow-x: hidden;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 1000;
    width: 48px;
    height: 48px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.theme-toggle:hover {
    transform: scale(1.05) rotate(15deg);
    box-shadow: var(--shadow-lg);
}

.theme-icon {
    color: var(--text-primary);
    transition: transform var(--transition-base);
}

/* Container */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: var(--space-xl);
    animation: fadeIn 0.6s ease-out;
}

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

/* Header */
.header {
    margin-bottom: var(--space-2xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-lg);
    animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-content {
    flex: 1;
}

.main-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}

.title-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 4px 12px rgba(37, 99, 235, 0.3));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

.header-actions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.action-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Special styling for Save button with advanced effects */
.action-btn:first-child {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.4),
                inset 0 -2px 8px rgba(0, 0, 0, 0.2);
    font-weight: 600;
}

.action-btn:first-child::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%);
    transform: rotate(45deg);
    animation: saveShine 3s infinite;
}

@keyframes saveShine {
    0%, 100% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    50% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.action-btn:first-child::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.action-btn:first-child:hover::after {
    width: 300px;
    height: 300px;
}

.action-btn:first-child:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.6),
                inset 0 -2px 10px rgba(0, 0, 0, 0.3),
                0 0 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-4px) scale(1.03);
}

.action-btn:first-child:active {
    transform: translateY(-1px) scale(0.97);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4),
                inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.action-btn:first-child svg {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: saveIconBounce 2s infinite;
}

@keyframes saveIconBounce {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-3px) rotate(-5deg);
    }
    75% {
        transform: translateY(-3px) rotate(5deg);
    }
}

.action-btn svg {
    transition: transform var(--transition-base);
}

.action-btn:hover svg {
    transform: scale(1.1);
}

/* Navigation Divider */
.nav-divider {
    width: 2px;
    height: 40px;
    background: var(--border-color);
    margin: 0 var(--space-xs);
}

/* Navigation Buttons */
.nav-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.nav-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.nav-btn svg {
    transition: transform var(--transition-base);
}

.nav-btn:hover svg {
    transform: scale(1.1);
}

/* Main Grid */
.main-grid {
    display: grid;
    grid-template-columns: minmax(380px, 450px) 1fr;
    gap: var(--space-xl);
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

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

@media (max-width: 1200px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

/* Cards */
.card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--border-color);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.reset-btn {
    padding: var(--space-xs) var(--space-md);
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.reset-btn:hover {
    background: var(--bearish);
    color: white;
    border-color: var(--bearish);
}

/* Input Panel */
.input-panel {
    position: sticky;
    top: var(--space-lg);
    max-height: calc(100vh - var(--space-xl) * 2);
    overflow-y: auto;
}

.input-panel::-webkit-scrollbar {
    width: 6px;
}

.input-panel::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.input-panel::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
}

.input-panel::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

.input-section {
    margin-bottom: var(--space-xl);
}

/* Stock Name Section */
.stock-name-section {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
}

.input-group {
    margin-bottom: var(--space-lg);
}

.input-group label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
    font-weight: 500;
}

.label-text {
    font-size: 0.9375rem;
}

.label-badge {
    padding: 2px 8px;
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding: var(--space-md);
    padding-right: 3rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text-primary);
    transition: all var(--transition-base);
}

.input-wrapper input[type="text"] {
    padding-right: var(--space-md);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-wrapper input::placeholder {
    color: var(--text-tertiary);
}

.input-unit {
    position: absolute;
    right: var(--space-md);
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-tertiary);
    pointer-events: none;
}

/* Stock Name Shortcuts */
.stock-name-shortcuts {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
    flex-wrap: wrap;
}

/* Save Stock Config Button with 3D effect */
.btn-save-config {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    margin-top: var(--space-md);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.3),
                inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
    transform: perspective(1000px) rotateX(0deg);
}

.btn-save-config::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.5), 
        transparent);
    transition: left 0.7s;
}

.btn-save-config:hover::before {
    left: 100%;
}

.btn-save-config::after {
    content: '💾';
    position: absolute;
    right: -50px;
    font-size: 1.8rem;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

.btn-save-config:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: perspective(1000px) rotateX(5deg) translateY(-3px) scale(1.02);
    box-shadow: 0 15px 50px rgba(16, 185, 129, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.4),
                inset 0 -1px 0 rgba(0, 0, 0, 0.3),
                0 0 30px rgba(16, 185, 129, 0.3);
}

.btn-save-config:hover::after {
    right: 25px;
    opacity: 1;
    transform: rotate(360deg);
}

.btn-save-config:active {
    transform: perspective(1000px) rotateX(0deg) translateY(0) scale(0.98);
    box-shadow: 0 5px 20px rgba(16, 185, 129, 0.4),
                inset 0 3px 10px rgba(0, 0, 0, 0.4);
}

.btn-save-config svg {
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
    animation: saveConfigPulse 2.5s infinite;
}

@keyframes saveConfigPulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.2) rotate(-10deg);
    }
    50% {
        transform: scale(1.1) rotate(0deg);
    }
    75% {
        transform: scale(1.2) rotate(10deg);
    }
}

@keyframes savePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Success animation for save buttons */
@keyframes saveSuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 30px rgba(16, 185, 129, 0.8);
    }
    100% {
        transform: scale(1);
    }
}

.save-success {
    animation: saveSuccess 0.6s ease-out;
}

/* Ripple effect on save */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.btn-save-config.saving::after,
.action-btn.saving::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    animation: ripple 0.6s ease-out;
}

/* Saved Configurations */
.saved-configs {
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
}

.saved-configs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.saved-configs-title {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.dropdown-wrapper {
    position: relative;
    width: 100%;
}

.saved-config-dropdown {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 2px solid var(--accent-primary);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
    font-weight: 500;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232563eb' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

.saved-config-dropdown:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

.saved-config-dropdown:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.saved-config-dropdown option {
    padding: var(--space-sm);
    font-weight: 500;
}

.saved-config-dropdown option:first-child {
    color: var(--text-tertiary);
    font-style: italic;
}

.delete-all-configs {
    padding: 6px 12px;
    background: transparent;
    color: var(--bearish);
    border: 1px solid var(--bearish);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.delete-all-configs:hover {
    background: var(--bearish);
    color: white;
}

/* Expiry Shortcuts (keeping existing) */
.expiry-shortcuts {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.shortcut-btn {
    flex: 1;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.shortcut-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

/* IV Indicator */
.iv-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.iv-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.iv-badge {
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
}

.iv-badge.low {
    background: var(--bullish-light);
    color: var(--bullish-dark);
}

.iv-badge.normal {
    background: var(--neutral-light);
    color: var(--neutral);
}

.iv-badge.elevated {
    background: var(--bearish-light);
    color: var(--bearish-dark);
}

.iv-badge.high {
    background: var(--bearish);
    color: white;
}

/* PCR Indicator */
.pcr-indicator {
    margin-top: var(--space-md);
}

.indicator-bar {
    position: relative;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: var(--space-sm);
}

.indicator-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-slow);
}

.indicator-marker {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--text-tertiary);
}

.indicator-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Divider */
.divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--space-xl) 0;
}

/* Preset Buttons */
.preset-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.preset-btn {
    padding: var(--space-md);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.preset-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Results Container */
.results-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.results-card {
    animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Directional Bias Card */
.bias-result {
    padding: var(--space-xl);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border-left: 5px solid var(--accent-primary);
    margin-bottom: var(--space-lg);
    transition: all var(--transition-base);
}

.bias-result.bullish {
    background: var(--gradient-bullish);
    border-left-color: var(--bullish);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3);
}

.bias-result.bearish {
    background: var(--gradient-bearish);
    border-left-color: var(--bearish);
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.3);
}

.bias-result.neutral {
    background: var(--gradient-neutral);
    border-left-color: var(--neutral);
    box-shadow: 0 8px 32px rgba(245, 158, 11, 0.3);
}

.bias-result.bullish,
.bias-result.bearish,
.bias-result.neutral {
    color: white;
    position: relative;
    overflow: hidden;
}

.bias-result.bullish::before,
.bias-result.bearish::before,
.bias-result.neutral::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmerGlow 3s infinite;
}

@keyframes shimmerGlow {
    0%, 100% {
        transform: translate(0, 0);
        opacity: 0.5;
    }
    50% {
        transform: translate(-30px, -30px);
        opacity: 0.8;
    }
}

.bias-main {
    text-align: center;
    position: relative;
    z-index: 1;
}

.bias-label {
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
    margin-bottom: var(--space-sm);
}

.bias-value {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-sm);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    animation: fadeInScale 0.6s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Advanced Placeholder Shimmer Effects */
@keyframes placeholderWave {
    0% {
        background-position: -200% 0;
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
    100% {
        background-position: 200% 0;
        opacity: 0.7;
    }
}

@keyframes placeholderPulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

/* Placeholder base styles */
.placeholder-shimmer {
    background: linear-gradient(90deg,
        var(--bg-tertiary) 0%,
        var(--border-color) 25%,
        var(--bg-secondary) 50%,
        var(--border-color) 75%,
        var(--bg-tertiary) 100%);
    background-size: 400% 100%;
    border-radius: var(--radius-sm);
    animation: placeholderWave 2s infinite ease-in-out;
    position: relative;
    overflow: hidden;
}

.placeholder-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent);
    animation: placeholderSlide 2s infinite;
}

@keyframes placeholderSlide {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Enhanced bias value placeholder */
.bias-value:empty,
.bias-value:contains("---") {
    display: inline-block;
    width: 200px;
    height: 50px;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.2) 25%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        rgba(255, 255, 255, 0.1) 100%);
    background-size: 400% 100%;
    border-radius: var(--radius-md);
    animation: placeholderWave 2s infinite ease-in-out;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
}

.bias-confidence {
    font-size: 1rem;
    opacity: 0.85;
}

.analysis-details {
    display: grid;
    gap: var(--space-md);
}

.detail-item {
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent-primary);
}

.detail-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.detail-value {
    font-size: 0.9375rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.confidence-badge {
    padding: 4px 12px;
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Price Visualization */
.price-visualization {
    margin-bottom: var(--space-lg);
}

.price-bar-container {
    position: relative;
    padding: var(--space-xl) 0;
    margin-bottom: var(--space-xl);
}

.price-bar {
    position: relative;
    height: 60px;
    background: linear-gradient(90deg, var(--bearish-light) 0%, var(--neutral-light) 50%, var(--bullish-light) 100%);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.current-price-marker {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
}

.marker-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.marker-value {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.expected-range {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(37, 99, 235, 0.3);
    border-left: 3px solid var(--accent-primary);
    border-right: 3px solid var(--accent-primary);
    animation: expandRange 1s ease-out;
}

@keyframes expandRange {
    from {
        opacity: 0;
        transform: scaleX(0);
    }
    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

/* Price Bands */
.price-bands {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.band-item {
    padding: var(--space-lg);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    text-align: center;
    transition: all var(--transition-base);
}

.band-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.band-item.upper {
    border-top: 3px solid var(--bullish);
}

.band-item.center {
    border-top: 3px solid var(--accent-primary);
}

.band-item.lower {
    border-top: 3px solid var(--bearish);
}

.band-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.band-value {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    position: relative;
    min-height: 2rem;
    transition: all var(--transition-base);
}

.band-value.main {
    font-size: 2rem;
    color: var(--accent-primary);
    animation: valueGlow 2s infinite;
}

@keyframes valueGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(37, 99, 235, 0.3);
    }
    50% {
        text-shadow: 0 0 25px rgba(37, 99, 235, 0.7),
                     0 0 40px rgba(37, 99, 235, 0.5);
    }
}

/* Enhanced placeholder shimmer for band values */
.band-value:empty,
.band-value:contains("---") {
    background: linear-gradient(90deg,
        var(--bg-secondary) 0%,
        var(--border-color) 20%,
        rgba(37, 99, 235, 0.1) 40%,
        var(--border-color) 60%,
        var(--bg-secondary) 100%);
    background-size: 400% 100%;
    border-radius: var(--radius-md);
    animation: bandShimmerAdvanced 2s infinite ease-in-out;
    display: inline-block;
    width: 120px;
    height: 2rem;
    box-shadow: inset 0 0 10px rgba(37, 99, 235, 0.1);
    position: relative;
    overflow: hidden;
}

.band-value:empty::after,
.band-value:contains("---")::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent);
    animation: bandSweep 2s infinite;
}

@keyframes bandShimmerAdvanced {
    0% {
        background-position: -200% 0;
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
    100% {
        background-position: 200% 0;
        opacity: 0.7;
    }
}

@keyframes bandSweep {
    0% {
        left: -30%;
    }
    100% {
        left: 130%;
    }
}

.band-change,
.band-sublabel {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.positive {
    color: var(--bullish);
}

.negative {
    color: var(--bearish);
}

/* Range Stats */
.range-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

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

.stat-label {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.stat-value {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-primary);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.stat-value:hover {
    transform: scale(1.08) translateY(-2px);
    text-shadow: 0 0 20px rgba(37, 99, 235, 0.6),
                 0 0 40px rgba(37, 99, 235, 0.3);
}

/* Enhanced placeholder shimmer for stats */
.stat-value:empty,
.stat-value:contains("---") {
    background: linear-gradient(135deg,
        var(--bg-secondary) 0%,
        var(--border-color) 25%,
        rgba(37, 99, 235, 0.15) 50%,
        var(--border-color) 75%,
        var(--bg-secondary) 100%);
    background-size: 400% 400%;
    border-radius: var(--radius-md);
    animation: statShimmerAdvanced 2.5s infinite ease-in-out;
    display: inline-block;
    width: 90px;
    height: 1.8rem;
    box-shadow: inset 0 0 15px rgba(37, 99, 235, 0.1),
                0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.stat-value:empty::before,
.stat-value:contains("---")::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle,
        rgba(255, 255, 255, 0.3) 0%,
        transparent 70%);
    animation: statPulseEffect 3s infinite;
}

@keyframes statShimmerAdvanced {
    0% {
        background-position: 0% 50%;
        opacity: 0.6;
    }
    50% {
        background-position: 100% 50%;
        opacity: 1;
    }
    100% {
        background-position: 0% 50%;
        opacity: 0.6;
    }
}

@keyframes statPulseEffect {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
}

/* Key Levels */
.key-levels {
    display: grid;
    gap: var(--space-lg);
}

.level-group {
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.level-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
}

.level-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-sm);
    transition: all var(--transition-base);
}

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

.level-item:hover {
    transform: translateX(4px);
}

.level-item.resistance {
    border-left: 3px solid var(--bullish);
}

.level-item.support {
    border-left: 3px solid var(--bearish);
}

.level-label {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.level-value {
    font-family: var(--font-mono);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.level-item:hover .level-value {
    color: var(--accent-primary);
    transform: scale(1.1);
    text-shadow: 0 0 15px rgba(37, 99, 235, 0.5);
}

/* Enhanced placeholder shimmer for level values */
.level-value:empty,
.level-value:contains("---") {
    background: linear-gradient(110deg,
        var(--bg-tertiary) 0%,
        var(--border-color) 25%,
        rgba(37, 99, 235, 0.12) 45%,
        rgba(37, 99, 235, 0.12) 55%,
        var(--border-color) 75%,
        var(--bg-tertiary) 100%);
    background-size: 400% 100%;
    border-radius: var(--radius-md);
    animation: levelShimmerAdvanced 2.8s infinite ease-in-out;
    display: inline-block;
    width: 100px;
    height: 1.6rem;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1),
                0 2px 12px rgba(37, 99, 235, 0.08);
    position: relative;
    overflow: hidden;
}

.level-value:empty::after,
.level-value:contains("---")::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 150%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%);
    transform: skewX(-20deg);
    animation: levelGlare 3s infinite;
}

@keyframes levelShimmerAdvanced {
    0% {
        background-position: -100% 0;
        opacity: 0.7;
    }
    50% {
        background-position: 50% 0;
        opacity: 1;
    }
    100% {
        background-position: 200% 0;
        opacity: 0.7;
    }
}

@keyframes levelGlare {
    0% {
        left: -150%;
    }
    50%, 100% {
        left: 150%;
    }
}

.level-divider {
    height: 1px;
    background: var(--border-color);
}

/* History Panel */
.history-panel {
    display: none;
    margin-top: var(--space-xl);
    animation: fadeIn 0.4s ease-out;
}

.history-panel.active {
    display: block;
}

.history-list {
    max-height: 600px;
    overflow-y: auto;
}

.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-tertiary);
    animation: fadeInUp 0.6s ease-out;
}

.empty-state svg {
    margin-bottom: var(--space-md);
    opacity: 0.5;
    animation: floatSlow 3s ease-in-out infinite;
}

@keyframes floatSlow {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.empty-state p {
    font-size: 1rem;
    font-weight: 500;
    background: linear-gradient(135deg, var(--text-tertiary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.history-item {
    padding: var(--space-lg);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    border-left: 4px solid var(--accent-primary);
    transition: all var(--transition-base);
    cursor: pointer;
}

.history-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.history-title-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.history-stock-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-primary);
    font-family: var(--font-mono);
}

.history-timestamp {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.history-delete {
    padding: 4px 8px;
    background: transparent;
    color: var(--text-tertiary);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
}

.history-delete:hover {
    background: var(--bearish);
    color: white;
}

.history-data {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.history-row {
    margin-bottom: var(--space-xs);
    line-height: 1.6;
}

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

.range-lower {
    color: var(--bearish);
    font-weight: 600;
}

.range-upper {
    color: var(--bullish);
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: var(--space-md);
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .action-btn,
    .nav-btn {
        flex: 1 1 calc(50% - var(--space-xs));
        min-width: 120px;
    }
    
    .nav-divider {
        display: none;
    }

    .main-title {
        font-size: 2rem;
    }

    .price-bands,
    .range-stats {
        grid-template-columns: 1fr;
    }

    .preset-buttons {
        grid-template-columns: 1fr;
    }

    .input-panel {
        position: static;
        max-height: none;
    }
    
    .stock-name-shortcuts {
        flex-direction: column;
    }
    
    .shortcut-btn {
        width: 100%;
    }
    
    .saved-configs-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }
    
    .delete-all-configs {
        width: 100%;
        justify-content: center;
    }
}

/* Utility Classes */
.text-bullish {
    color: var(--bullish) !important;
}

.text-bearish {
    color: var(--bearish) !important;
}

.text-neutral {
    color: var(--neutral) !important;
}

/* Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading {
    background: linear-gradient(90deg, var(--bg-tertiary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Advanced Loading States and Success Animations */
@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.btn-save-config.loading svg,
.action-btn.loading svg {
    animation: spin 0.8s linear infinite;
}

/* Checkmark success animation */
@keyframes checkmark {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.3) rotate(-45deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(-45deg);
        opacity: 1;
    }
}

.btn-save-config.success::after,
.action-btn.success::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: bold;
    color: white;
    animation: checkmark 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
