:root {
    /* Light mode colors */
    --bg-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-secondary: rgba(255, 255, 255, 0.95);
    --bg-tertiary: white;
    --bg-info: #f0fff4;
    --bg-api: #ebf8ff;
    --bg-warning: #fff5f5;
    --bg-chart: white;
    --bg-stock-info: #f8fafc;
    --bg-card: white;
    
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --text-info: #2f855a;
    --text-api: #2c5282;
    --text-warning: #c53030;
    
    --border-primary: #e2e8f0;
    --border-info: #38a169;
    --border-api: #3182ce;
    --border-api-input: #bee3f8;
    
    --shadow-primary: rgba(0, 0, 0, 0.1);
    --shadow-secondary: rgba(0, 0, 0, 0.1);
    
    --gradient-text: linear-gradient(45deg, #667eea, #764ba2);
    --gradient-button: linear-gradient(45deg, #667eea, #764ba2);
    --gradient-button-hover: rgba(102, 126, 234, 0.3);
    
    --focus-color: #667eea;
    --focus-shadow: rgba(102, 126, 234, 0.1);
    --api-focus-color: #3182ce;
    --api-focus-shadow: rgba(49, 130, 206, 0.1);
}

[data-theme="dark"] {
    /* Dark mode colors */
    --bg-primary: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    --bg-secondary: rgba(26, 32, 44, 0.95);
    --bg-tertiary: #2d3748;
    --bg-info: #1a2e1a;
    --bg-api: #1a2332;
    --bg-warning: #2d1b1b;
    --bg-chart: #2d3748;
    --bg-stock-info: #1a202c;
    --bg-card: #2d3748;
    
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #a0aec0;
    --text-info: #68d391;
    --text-api: #63b3ed;
    --text-warning: #fc8181;
    
    --border-primary: #4a5568;
    --border-info: #68d391;
    --border-api: #63b3ed;
    --border-api-input: #4a5568;
    
    --shadow-primary: rgba(0, 0, 0, 0.3);
    --shadow-secondary: rgba(0, 0, 0, 0.2);
    
    --gradient-text: linear-gradient(45deg, #63b3ed, #805ad5);
    --gradient-button: linear-gradient(45deg, #4299e1, #805ad5);
    --gradient-button-hover: rgba(66, 153, 225, 0.3);
    
    --focus-color: #63b3ed;
    --focus-shadow: rgba(99, 179, 237, 0.2);
    --api-focus-color: #63b3ed;
    --api-focus-shadow: rgba(99, 179, 237, 0.2);
}

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

body {
    font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    padding: 20px;
    transition: background 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px var(--shadow-primary);
    transition: all 0.3s ease;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    background: var(--gradient-button);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--gradient-button-hover);
}

h1 {
    color: var(--text-primary);
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.theme-toggle {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 20px;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px var(--shadow-secondary);
    border-color: var(--focus-color);
}

.search-section {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: end;
}

.form-group {
    flex: 1;
    min-width: 250px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
}

input, select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-primary);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--focus-color);
    box-shadow: 0 0 0 3px var(--focus-shadow);
}

button {
    padding: 12px 24px;
    background: var(--gradient-button);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px var(--gradient-button-hover);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.info-section {
    background: var(--bg-info);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid var(--border-info);
    transition: all 0.3s ease;
}

.info-section h3 {
    color: var(--text-info);
    margin-bottom: 10px;
}

.info-section p {
    color: var(--text-muted);
    font-size: 14px;
}

.data-source-indicator {
    background: var(--bg-warning);
    color: var(--text-warning);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 10px;
    border: 1px solid rgba(197, 48, 48, 0.2);
    display: flex;
    align-items: center;
    gap: 6px;
}

.data-source-indicator.api-connected {
    background: var(--bg-info);
    color: var(--text-info);
    border: 1px solid rgba(56, 161, 105, 0.2);
}

.data-source-indicator.quota-exceeded {
    background: #fef5e7;
    color: #d69e2e;
    border: 1px solid rgba(214, 158, 46, 0.2);
}

[data-theme="dark"] .data-source-indicator.quota-exceeded {
    background: #2d1f0b;
    color: #f6e05e;
}

.data-source-indicator::before {
    content: "⚠️";
    font-size: 14px;
}

.data-source-indicator.api-connected::before {
    content: "✅";
    font-size: 14px;
}

.data-source-indicator.quota-exceeded::before {
    content: "⏳";
    font-size: 14px;
}

.api-section {
    background: var(--bg-api);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid var(--border-api);
    transition: all 0.3s ease;
}

.api-section .form-group {
    margin-bottom: 0;
}

.api-section label {
    color: var(--text-api);
    font-weight: 600;
}

.api-section input {
    border-color: var(--border-api-input);
}

.api-section input:focus {
    border-color: var(--api-focus-color);
    box-shadow: 0 0 0 3px var(--api-focus-shadow);
}

.help-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    transition: color 0.3s ease;
}

/* Market Indices Section */
.market-indices-section {
    background: var(--bg-tertiary);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    border: 2px solid var(--border-primary);
    transition: all 0.3s ease;
}

.market-indices-section h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.4em;
    font-weight: 600;
}

.indices-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.indices-header h3 {
    margin-bottom: 0;
}

.market-status {
    display: flex;
    align-items: center;
}

.status-indicator {
    font-size: 0.85em;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--bg-stock-info);
    color: var(--text-muted);
    border: 1px solid var(--border-primary);
}

.status-indicator.open {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border-color: #22c55e;
}

.status-indicator.closed {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: #ef4444;
}

.indices-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.index-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-primary);
    box-shadow: 0 4px 6px var(--shadow-secondary);
    transition: all 0.3s ease;
    cursor: pointer;
}

.index-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px var(--shadow-primary);
    border-color: var(--focus-color);
}

.index-card.active {
    border-color: var(--focus-color);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2), 0 8px 15px var(--shadow-primary);
    transform: translateY(-1px);
}

.index-card.active .index-header h4 {
    color: var(--focus-color);
}

.index-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.index-header h4 {
    color: var(--text-primary);
    font-size: 1.1em;
    font-weight: 600;
    margin: 0;
}

.index-symbol {
    color: var(--text-muted);
    font-size: 0.9em;
    font-weight: 500;
    background: var(--bg-stock-info);
    padding: 4px 8px;
    border-radius: 6px;
}

.index-value {
    margin-bottom: 15px;
}

.index-price {
    display: block;
    font-size: 1.5em;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.index-price.loading {
    color: var(--text-muted);
    font-style: italic;
}

.index-change {
    font-size: 0.9em;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.index-change.positive {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.index-change.negative {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.index-change.loading {
    color: var(--text-muted);
    background: var(--bg-stock-info);
}

.index-chart-btn {
    width: 100%;
    padding: 10px;
    background: var(--gradient-button);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.index-chart-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--gradient-button-hover);
}

.indices-refresh {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-primary);
}

#refreshIndices {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

#refreshIndices:hover {
    background: var(--bg-stock-info);
    transform: translateY(-1px);
}

.refresh-icon {
    font-size: 1.2em;
    transition: transform 0.3s ease;
}

#refreshIndices:hover .refresh-icon {
    transform: rotate(180deg);
}

.last-updated {
    color: var(--text-muted);
    font-size: 0.85em;
}

/* Cryptocurrency Section */
.crypto-section {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-primary);
}

.crypto-section h3 {
    margin: 0 0 20px 0;
    color: var(--text-primary);
    font-size: 1.4em;
    font-weight: 600;
}

.crypto-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.crypto-header h3 {
    margin: 0;
}

.crypto-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.crypto-status .status-indicator {
    background: linear-gradient(135deg, #f7931a, #ff6b35);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(247, 147, 26, 0.3);
}

.crypto-status .status-indicator::before {
    content: '₿';
    font-size: 1.1em;
    animation: pulse 2s infinite;
}

.crypto-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.crypto-card {
    background: var(--bg-stock-info);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.crypto-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f7931a, #ff6b35, #f7931a);
    background-size: 200% 100%;
    animation: shimmer 3s infinite;
}

.crypto-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #f7931a;
}

.crypto-card.active {
    border: 2px solid #f7931a;
    box-shadow: 0 0 20px rgba(247, 147, 26, 0.3);
    background: var(--bg-card);
}

.crypto-card.active .crypto-header-card h4 {
    color: #f7931a;
}

.crypto-header-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.crypto-header-card h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1em;
    font-weight: 600;
}

.crypto-symbol {
    background: #f7931a;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.crypto-value {
    margin-bottom: 15px;
}

.crypto-price {
    display: block;
    font-size: 1.3em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.crypto-change {
    font-size: 0.9em;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
}

.crypto-change.positive {
    background: rgba(56, 161, 105, 0.1);
    color: #38a169;
}

.crypto-change.negative {
    background: rgba(229, 62, 62, 0.1);
    color: #e53e3e;
}

.crypto-chart-btn {
    background: linear-gradient(135deg, #f7931a, #ff6b35);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.3s ease;
    width: 100%;
}

.crypto-chart-btn:hover {
    background: linear-gradient(135deg, #e8841a, #e55a2b);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(247, 147, 26, 0.3);
}

.crypto-refresh {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-primary);
}

#refreshCrypto {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #f7931a, #ff6b35);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

#refreshCrypto:hover {
    background: linear-gradient(135deg, #e8841a, #e55a2b);
    transform: translateY(-1px);
}

#refreshCrypto:hover .refresh-icon {
    transform: rotate(180deg);
}

.last-updated-crypto {
    color: var(--text-muted);
    font-size: 0.85em;
}

.crypto-note {
    margin-top: 15px;
    padding: 10px 15px;
    background: rgba(247, 147, 26, 0.1);
    border-left: 3px solid #f7931a;
    border-radius: 6px;
}

.crypto-note p {
    margin: 0;
    color: var(--text-secondary);
}

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

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

@media (max-width: 768px) {
    .indices-container {
        grid-template-columns: 1fr;
    }
    
    .indices-refresh {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .indices-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .indices-header h3 {
        margin-bottom: 0;
    }
    
    .crypto-container {
        grid-template-columns: 1fr;
    }
    
    .crypto-refresh {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .crypto-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .crypto-header h3 {
        margin-bottom: 0;
    }
}

.warning-section {
    background: var(--bg-warning);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px;
    transition: all 0.3s ease;
}

.warning-section h3 {
    color: var(--text-warning);
}

.warning-section p {
    color: var(--text-muted);
    font-size: 14px;
}

.chart-section {
    margin-top: 30px;
    background: var(--bg-chart);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 25px var(--shadow-primary);
    transition: all 0.3s ease;
}

.chart-container {
    position: relative;
    height: 500px;
    margin-top: 20px;
}

.loading {
    display: none;
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.loading.show {
    display: block;
}

.spinner {
    border: 3px solid var(--border-primary);
    border-top: 3px solid var(--focus-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.error {
    background: var(--bg-warning);
    color: var(--text-warning);
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    display: none;
    transition: all 0.3s ease;
}

.error.show {
    display: block;
}

.stock-info {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
    padding: 20px;
    background: var(--bg-stock-info);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.stock-info.show {
    display: grid;
}

.info-card {
    text-align: center;
    padding: 15px;
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-secondary);
    transition: all 0.3s ease;
}

.info-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 5px;
}

.info-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.price-change.positive {
    color: #38a169;
}

.price-change.negative {
    color: #e53e3e;
}

@media (max-width: 768px) {
    .input-group {
        flex-direction: column;
    }

    .form-group {
        min-width: 100%;
    }

    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    h1 {
        font-size: 2rem;
    }

    .theme-toggle {
        align-self: center;
    }

    .comparison-inputs {
        flex-direction: column;
    }

    .stock-input-group {
        width: 100%;
        margin-bottom: 20px;
    }

    .vs-divider {
        transform: rotate(90deg);
        margin: 10px 0;
    }

    .comparison-charts {
        flex-direction: column;
    }

    .chart-side {
        width: 100%;
        margin-bottom: 20px;
    }

    .comparison-info {
        flex-direction: column;
        gap: 20px;
    }

    .stock-info-side {
        width: 100%;
    }
}

/* Mode Section Styles */
.mode-section {
    margin-bottom: 25px;
    padding: 25px;
    background: var(--bg-tertiary);
    border-radius: 15px;
    box-shadow: 0 5px 15px var(--shadow-secondary);
    border: 1px solid var(--border-primary);
}

.mode-toggle {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
    margin-bottom: 15px;
}

.mode-option {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    user-select: none;
}

.mode-option.active {
    color: var(--text-primary);
    background: var(--gradient-button);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.mode-description {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    font-style: italic;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch:hover .slider {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.toggle-switch:hover .slider:before {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border-primary);
    transition: all 0.3s ease;
    border-radius: 15px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 3px;
    top: 3px;
    background: white;
    transition: all 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background: var(--gradient-button);
}

input:checked + .slider:before {
    transform: translateX(30px);
}

/* Comparison Mode Styles */
.comparison-mode {
    background: linear-gradient(135deg, var(--bg-info) 0%, rgba(240, 255, 244, 0.3) 100%);
    border: 2px solid var(--border-info);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(56, 161, 105, 0.1);
}

[data-theme="dark"] .comparison-mode {
    background: linear-gradient(135deg, var(--bg-info) 0%, rgba(26, 46, 26, 0.3) 100%);
    box-shadow: 0 8px 25px rgba(104, 211, 145, 0.1);
}

.comparison-inputs {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 25px;
}

.stock-input-group {
    flex: 1;
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 3px 10px var(--shadow-secondary);
}

.stock-input-group h4 {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 18px;
    text-align: center;
}

.vs-divider {
    background: var(--gradient-button);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    position: relative;
    z-index: 1;
}

.vs-divider::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: var(--gradient-button);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.3;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.1;
    }
    100% {
        transform: scale(1);
        opacity: 0.3;
    }
}

.comparison-controls {
    display: flex;
    align-items: end;
    gap: 20px;
    justify-content: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-primary);
}

.comparison-chart-container {
    margin-top: 30px;
}

.comparison-info {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.stock-info-side {
    flex: 1;
    background: var(--bg-stock-info);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 3px 10px var(--shadow-secondary);
}

.stock-info-side h4 {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 18px;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-primary);
}

.stock-info-side .stock-info {
    gap: 15px;
}

.comparison-charts {
    display: flex;
    gap: 20px;
}

.chart-side {
    flex: 1;
    background: var(--bg-chart);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 15px var(--shadow-secondary);
}

.chart-side .chart-container {
    margin: 0;
}

#compareButton {
    background: var(--gradient-button);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#compareButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

#compareButton:active {
    transform: translateY(0);
}

/* Export Controls Styles */
.export-controls {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px var(--shadow-secondary);
    transition: all 0.3s ease;
}

.export-controls h4 {
    color: var(--text-primary);
    margin: 0 0 15px 0;
    font-size: 1.1em;
    font-weight: 600;
    text-align: center;
}

.export-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.export-buttons button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--gradient-button);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    min-width: 160px;
}

.export-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.export-buttons button:active {
    transform: translateY(0);
}

.export-buttons button span {
    font-size: 16px;
}

@media (max-width: 768px) {
    .export-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .export-buttons button {
        width: 100%;
        max-width: 250px;
    }
}

/* Forex Trading Styles */
.forex-section {
    background: var(--bg-tertiary);
    border-radius: 15px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 10px 25px var(--shadow-primary);
    border: 1px solid var(--border-primary);
    transition: all 0.3s ease;
}

.forex-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.forex-header h3 {
    color: var(--text-primary);
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.forex-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.forex-container {
    max-width: 900px;
    margin: 0 auto;
}

.forex-input {
    display: flex;
    align-items: end;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 20px;
    background: var(--bg-stock-info);
    border-radius: 12px;
    border: 1px solid var(--border-primary);
}

.currency-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 180px;
}

.currency-selector label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.forex-input select {
    padding: 12px 16px;
    border: 2px solid var(--border-primary);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.forex-input select:hover {
    border-color: var(--focus-color);
}

.forex-input select:focus {
    border-color: var(--focus-color);
    box-shadow: 0 0 0 3px var(--focus-shadow);
}

.currency-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.currency-separator {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-primary);
}

#swapCurrencies {
    background: var(--gradient-button);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin: 0;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#swapCurrencies:hover {
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 4px 12px var(--gradient-button-hover);
}

#swapCurrencies:active {
    transform: rotate(180deg) scale(0.95);
}

.swap-icon {
    font-size: 18px;
    font-weight: bold;
    transition: transform 0.3s ease;
}

#addForexPair {
    background: var(--gradient-button);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 20px;
    height: fit-content;
}

#addForexPair:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--gradient-button-hover);
}

.forex-pairs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
    font-style: italic;
}

.forex-pair-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.forex-pair-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--shadow-secondary);
    border-color: var(--focus-color);
}

.forex-pair-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.forex-pair-symbol {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.currency-flag {
    font-size: 20px;
}

.forex-rate {
    font-size: 28px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
}

.forex-change {
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 10px;
}

.forex-change.positive {
    background: #d1fae5;
    color: #065f46;
}

.forex-change.negative {
    background: #fee2e2;
    color: #991b1b;
}

.forex-change.neutral {
    background: var(--bg-stock-info);
    color: var(--text-muted);
}

.forex-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
    font-size: 12px;
    color: var(--text-muted);
}

.forex-detail-item {
    display: flex;
    justify-content: space-between;
}

.forex-timestamp {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-primary);
}

.remove-forex-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.remove-forex-btn:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.forex-refresh {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--border-primary);
    flex-wrap: wrap;
    gap: 15px;
}

#refreshForex {
    background: var(--gradient-button);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

#refreshForex:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--gradient-button-hover);
}

.refresh-icon {
    font-size: 16px;
    transition: transform 0.3s ease;
}

#refreshForex:hover .refresh-icon {
    transform: rotate(180deg);
}

.last-updated-forex {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.forex-note {
    margin-top: 20px;
    padding: 15px;
    background: var(--bg-info);
    border: 1px solid var(--border-info);
    border-radius: 8px;
}

.forex-note p {
    margin: 0;
    color: var(--text-info);
    font-size: 0.9rem;
    line-height: 1.5;
}

.forex-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-muted);
}

.forex-loading .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-primary);
    border-top: 2px solid var(--focus-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@media (max-width: 768px) {
    .forex-input {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .currency-controls {
        flex-direction: row;
        margin: 15px 0;
        align-self: center;
    }
    
    .currency-separator {
        margin: 0 10px;
    }
    
    .currency-selector {
        min-width: auto;
    }
    
    .forex-pairs {
        grid-template-columns: 1fr;
    }
    
    .forex-refresh {
        flex-direction: column;
        text-align: center;
    }
    
    .forex-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .forex-section {
        padding: 20px;
        margin: 20px 0;
    }
    
    .forex-input {
        padding: 15px;
    }
    
    .forex-pair-card {
        padding: 15px;
    }
    
    .forex-rate {
        font-size: 24px;
    }
}
