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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #000000;
    color: #ffffff;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

.header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 20px;
}

header h1 {
    font-size: 2.2rem;
    margin: 0;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
    font-weight: 300;
}

.language-toggle {
    position: absolute;
    right: 0;
    background: rgba(42, 42, 42, 0.6);
    border: 1px solid #404040;
    border-radius: 20px;
    padding: 8px 16px;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(10px);
}

.language-toggle:hover {
    background: rgba(42, 42, 42, 0.8);
    border-color: #00c805;
    transform: translateY(-1px);
}

.lang-text {
    transition: all 0.3s ease;
    font-weight: 600;
}

.lang-text.inactive {
    opacity: 0.5;
    font-weight: 400;
}

.lang-separator {
    opacity: 0.3;
    font-weight: 300;
}

.hero-search {
    background: transparent;
    border-radius: 16px;
    padding: 12px;
    margin: 20px auto;
    max-width: 800px;
}

.hero-input-container {
    display: flex;
    gap: 8px;
    background: linear-gradient(135deg, #111111 0%, #1a1a1a 100%);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid #333333;
    box-shadow: 
        inset 0 1px 8px rgba(0, 0, 0, 0.3),
        0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.hero-input-container:focus-within {
    border-color: #666666;
    box-shadow: 
        inset 0 1px 8px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 0 12px rgba(255, 255, 255, 0.05);
}

#heroInput {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 400;
    outline: none;
    transition: all 0.3s ease;
}

#heroInput::placeholder {
    color: #777777;
    font-weight: 400;
    font-style: italic;
}

#heroInput:focus {
    background: rgba(255, 255, 255, 0.02);
}

.hero-ask-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #4a4a4a 0%, #3a3a3a 100%);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    min-width: 80px;
    position: relative;
    overflow: hidden;
}

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

.hero-ask-btn:hover::before {
    left: 100%;
}

.hero-ask-btn:hover {
    background: linear-gradient(135deg, #5a5a5a 0%, #4a4a4a 100%);
    transform: translateY(-1px);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.hero-ask-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 1px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

header p {
    color: #9ca3af;
    font-size: 1.1rem;
    font-weight: 300;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stock-selector, .time-range, .refresh-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.controls label {
    font-weight: 600;
    color: #e0e0e0;
}

.controls select {
    padding: 10px 15px;
    border: 1px solid #333333;
    border-radius: 6px;
    background: #1a1a1a;
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.controls select:hover, .controls select:focus {
    border-color: #00c805;
    outline: none;
    background: #2a2a2a;
}

.refresh-btn {
    padding: 10px 20px;
    background: #00c805;
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.refresh-btn:hover {
    background: #00a804;
    transform: translateY(-1px);
}

.main-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 40px;
}

.chart-container-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Integrated Chart Section */

.chart-header {
    display: flex;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, #111111 0%, #1a1a1a 100%);
    border-bottom: 1px solid #262626;
}

.stock-info-compact {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
}

.stock-info-compact h2 {
    font-size: 1.5rem;
    margin: 0;
    color: #ffffff;
    font-weight: 400;
}

.stock-info-compact .stock-price {
    display: flex;
    align-items: center;
    gap: 15px;
}

.stock-info-compact #currentPrice {
    font-size: 1.8rem;
    font-weight: bold;
    color: #ffffff;
    transition: all 0.3s ease;
    position: relative;
}

.stock-info-compact #currentPrice.price-update {
    animation: priceFlash 0.8s ease-out;
}

.chart-controls {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.price-change {
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.price-change.price-update {
    animation: changeFlash 0.8s ease-out;
}

@keyframes priceFlash {
    0% { 
        background: rgba(0, 200, 5, 0.3);
        border-radius: 8px;
        padding: 4px 8px;
        transform: scale(1.05);
    }
    50% { 
        background: rgba(0, 200, 5, 0.2);
        transform: scale(1.02);
    }
    100% { 
        background: transparent;
        padding: 0;
        transform: scale(1);
    }
}

@keyframes changeFlash {
    0% { 
        background: rgba(0, 200, 5, 0.2);
        border-radius: 6px;
        padding: 2px 6px;
        transform: scale(1.03);
    }
    50% { 
        background: rgba(0, 200, 5, 0.1);
        transform: scale(1.01);
    }
    100% { 
        background: transparent;
        padding: 0;
        transform: scale(1);
    }
}

.metrics-toggle {
    padding: 8px 16px;
    background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
    border: 1px solid #404040;
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 100px;
}

.metrics-toggle:hover {
    background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
    border-color: #00c805;
    transform: translateY(-1px);
}

.toggle-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.metrics-toggle.expanded .toggle-arrow {
    transform: rotate(180deg);
}

/* Three Column Layout: Details (1/3) | Chart (2/3) */
.three-column-layout {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

/* Left Details Sidebar - Always Visible (1/3) */
.details-sidebar {
    flex: 0 0 33.333%;
    background: linear-gradient(135deg, #1a1a1a 0%, #1e1e1e 100%);
    border-radius: 12px;
    border: 1px solid #333333;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    height: fit-content;
}

.details-header {
    padding: 20px;
    border-bottom: 1px solid #262626;
    background: linear-gradient(135deg, #111111 0%, #1a1a1a 100%);
}

.details-header h3 {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.details-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 600px;
    overflow-y: auto;
}

.current-date {
    color: #b0b0b0;
    padding: 12px 16px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

/* Right Chart Section (2/3) */
.chart-section {
    flex: 0 0 66.666%;
    background: linear-gradient(135deg, #1a1a1a 0%, #1e1e1e 100%);
    border-radius: 12px;
    border: 1px solid #333333;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.metric-group h4 {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #00c805;
    padding-bottom: 8px;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(42, 42, 42, 0.5);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.metric-item:hover {
    background: rgba(42, 42, 42, 0.8);
    transform: translateX(2px);
}

.metric-item .label {
    color: #b0b0b0;
    font-size: 0.9rem;
    font-weight: 500;
}

.metric-item span:last-child {
    font-weight: 600;
    color: #ffffff;
}

.thesis-group {
    grid-column: 1 / -1;
}

.thesis-group .bulls-section, 
.thesis-group .bears-section {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 8px;
    background: rgba(42, 42, 42, 0.3);
}

.thesis-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.thesis-title.bulls {
    color: #00c805;
}

.thesis-title.bears {
    color: #ff5733;
}

.thesis-text {
    font-size: 0.85rem;
    line-height: 1.4;
    color: #b0b0b0;
    margin: 0;
}

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

@media (max-width: 968px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.stock-info {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 25px;
    border: 1px solid #333333;
    height: 100%;
    justify-content: space-between;
}

.stock-header {
    margin-bottom: 20px;
}

.stock-header h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #ffffff;
    font-weight: 400;
}

.stock-price {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#currentPrice {
    font-size: 2rem;
    font-weight: bold;
    color: #ffffff;
}

.price-change {
    font-size: 1rem;
    font-weight: 600;
}

.price-change.positive {
    color: #00c805;
}

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

.stock-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #2a2a2a;
    border-radius: 6px;
}

.detail-item .label {
    color: #b0b0b0;
    font-size: 0.9rem;
}

.detail-item span:last-child {
    font-weight: 600;
    color: #ffffff;
}

.earnings-section {
    margin-top: 20px;
    margin-bottom: 20px;
    border-top: 1px solid #333333;
    padding-top: 15px;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.earnings-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.earnings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #2a2a2a;
    border-radius: 6px;
}

.earnings-item .label {
    color: #9ca3af;
    font-size: 0.9rem;
}

.earnings-item span:last-child {
    font-weight: 600;
    color: #ffffff;
}

.earnings-link {
    color: #00c805;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.earnings-link:hover {
    color: #00a804;
    text-decoration: underline;
}

.thesis-section {
    margin-top: 10px;
    border-top: 1px solid #333333;
    padding-top: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.bulls-section, .bears-section {
    margin-bottom: 20px;
}

.bears-section {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.bears-section .thesis-text {
    flex-grow: 1;
}

.thesis-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.thesis-title.bulls {
    color: #00c805;
}

.thesis-title.bears {
    color: #ff5733;
}

.thesis-text {
    font-size: 0.85rem;
    line-height: 1.4;
    color: #b0b0b0;
    margin: 0;
}

/* AI Chat Section Styles - Grok-inspired */
.ai-chat-section {
    background: #0a0a0a;
    border-radius: 16px;
    border: 1px solid #262626;
    overflow: hidden;
    height: fit-content;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.chat-header {
    padding: 16px 20px 12px 20px;
    border-bottom: 1px solid #1a1a1a;
    background: linear-gradient(135deg, #111111 0%, #1a1a1a 100%);
}

.chat-header h3 {
    font-size: 1.2rem;
    margin: 0;
    color: #ffffff;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.chat-container {
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    height: 240px;
    overflow-y: auto;
    padding: 16px 20px;
    background: #0a0a0a;
    scroll-behavior: smooth;
}

.chat-message {
    margin-bottom: 12px;
    display: flex;
    width: 100%;
}

.chat-message:last-child {
    margin-bottom: 0;
}

/* iPhone-style message bubbles */
.message-content {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

/* AI messages - left side (gray) */
.ai-message {
    justify-content: flex-start;
}

.ai-message .message-content {
    background: #2a2a2a;
    color: #ffffff;
    border-bottom-left-radius: 4px;
    margin-right: auto;
}

/* User messages - right side (blue) */
.user-message {
    justify-content: flex-end;
}

.user-message .message-content {
    background: #007AFF;
    color: #ffffff;
    border-bottom-right-radius: 4px;
    margin-left: auto;
}

/* Remove avatars completely for iPhone style */
.message-avatar {
    display: none;
}

.message-sender {
    display: none;
}

.message-content p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #ffffff;
    font-weight: 400;
}

.typing-indicator {
    font-size: 1.2rem;
    letter-spacing: 2px;
    opacity: 0.6;
    animation: typing-dots 1.4s ease-in-out infinite;
}

@keyframes typing-dots {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

.chat-input-container {
    display: flex;
    padding: 16px 20px;
    background: linear-gradient(135deg, #111111 0%, #1a1a1a 100%);
    border-top: 1px solid #1a1a1a;
    gap: 12px;
}

#chatInput {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #262626;
    border-radius: 10px;
    background: #0a0a0a;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 400;
    transition: all 0.2s ease;
}

#chatInput:focus {
    outline: none;
    border-color: #00c805;
    background: #111111;
    box-shadow: 0 0 0 3px rgba(0, 200, 5, 0.1);
}

#chatInput:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#chatInput::placeholder {
    color: #6b7280;
    font-weight: 400;
}

.chat-send-btn {
    padding: 16px 24px;
    background: linear-gradient(135deg, #00c805 0%, #00a804 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 200, 5, 0.2);
}

.chat-send-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #00a804 0%, #009603 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 200, 5, 0.3);
}

.chat-suggestions {
    padding: 16px 20px;
    background: #0a0a0a;
    border-top: 1px solid #1a1a1a;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
}

.suggestion-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 16px;
    background: #1a1a1a;
    border: 1px solid #262626;
    border-radius: 16px;
    color: #e5e7eb;
    font-size: 0.85rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: normal;
    overflow: visible;
    text-align: center;
    position: relative;
    line-height: 1.3;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.suggestion-btn:hover {
    background: #262626;
    border-color: #00c805;
    color: #ffffff;
    transform: translateY(-1px);
}

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

/* Tooltip removed since full text is now visible */

/* Mobile responsive suggestions */
@media (max-width: 768px) {
    .chat-suggestions {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .suggestion-btn {
        flex-basis: calc(50% - 4px);
        font-size: 0.8rem;
        padding: 10px 12px;
        min-width: 100px;
        min-height: 40px;
    }
}

@media (max-width: 480px) {
    .chat-suggestions {
        flex-direction: column;
        gap: 6px;
    }
    
    .suggestion-btn {
        flex-basis: auto;
        width: 100%;
        min-width: auto;
        font-size: 0.85rem;
        padding: 12px 16px;
        min-height: 44px;
    }
}

.chat-status {
    color: #888888;
    font-style: italic;
}

/* Scrollbar styling for chat messages */
.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 2px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

.chart-container {
    padding: 25px;
    height: 450px;
    position: relative;
}


.time-range-pills {
    display: flex;
    gap: 6px;
    padding: 4px;
    background: rgba(42, 42, 42, 0.4);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.time-pill {
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: #b0b0b0;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-width: 40px;
}

.time-pill:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.time-pill.active {
    background: linear-gradient(135deg, #00c805 0%, #00a804 100%);
    color: #ffffff;
    border-color: #00c805;
    box-shadow: 
        0 2px 8px rgba(0, 200, 5, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.time-pill.active:hover {
    transform: translateY(-1px);
    box-shadow: 
        0 4px 12px rgba(0, 200, 5, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.stock-header {
    margin-bottom: 20px;
}

.stock-header h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #ffffff;
    font-weight: 400;
}

.stock-price {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#currentPrice {
    font-size: 2rem;
    font-weight: bold;
    color: #ffffff;
}

.price-change {
    font-size: 1rem;
    font-weight: 600;
}

.price-change.positive {
    color: #00c805;
}

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

.mag7-overview {
    margin-top: 40px;
}

.mag7-overview h3 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: #ffffff;
    font-weight: 400;
}

.mag7-overview {
    margin-top: 40px;
}

.stock-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 15px;
}

.stock-card {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #333333;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.stock-card:hover {
    transform: translateY(-2px);
    background: #2a2a2a;
    border-color: #00c805;
    box-shadow: 0 4px 20px rgba(0, 200, 5, 0.15);
}

.stock-card.active {
    border-color: #00c805;
    background: #2a2a2a;
    box-shadow: 0 2px 16px rgba(0, 200, 5, 0.2);
    transform: translateY(-1px);
}

.stock-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s;
}

.stock-card:hover::before {
    left: 100%;
}

.stock-card h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #ffffff;
    font-weight: 400;
}

.stock-card .symbol {
    font-size: 0.9rem;
    color: #b0b0b0;
    margin-bottom: 10px;
}

.stock-card .price {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 5px;
    transition: opacity 0.3s ease;
}

.stock-card .change {
    font-size: 0.9rem;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

.stock-card .change.positive {
    color: #00c805;
}

.stock-card .change.negative {
    color: #ff5733;
}

.stock-card .change.loading {
    color: #666666;
    font-style: italic;
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    display: none;
}

.loading.show {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 200, 5, 0.3);
    border-top: 4px solid #00c805;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading p {
    font-size: 1.1rem;
    color: #b0b0b0;
}

#stockChart {
    max-height: 450px;
}

@media (max-width: 1024px) {
    .controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .stock-selector, .time-range {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stock-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
}

@media (max-width: 1200px) {
    .three-column-layout {
        flex-direction: column;
        gap: 15px;
    }
    
    .details-sidebar {
        flex: none;
        order: 2;
    }
    
    .chart-section {
        flex: none;
        order: 1;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .hero-search {
        padding: 10px 12px;
        margin: 15px auto;
    }
    
    .hero-input-container {
        flex-direction: column;
        gap: 8px;
    }
    
    #heroInput {
        padding: 12px 16px;
        font-size: 1rem;
    }
    
    .hero-ask-btn {
        padding: 12px 20px;
        font-size: 0.95rem;
        width: 100%;
    }
    
    .chart-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }
    
    .stock-info-compact {
        justify-content: center;
        gap: 15px;
    }
    
    .stock-info-compact h2 {
        font-size: 1.3rem;
    }
    
    .stock-info-compact #currentPrice {
        font-size: 1.6rem;
    }
    
    .stock-info-compact .stock-price {
        flex-direction: column;
        gap: 5px;
        align-items: center;
    }
    
    .chart-controls {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
    
    .chart-container {
        height: 350px;
        padding: 15px;
    }
    
    .time-range-pills {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
        padding: 4px;
    }
    
    .time-pill {
        padding: 6px 12px;
        font-size: 0.8rem;
        min-width: 35px;
    }
    
    .details-content {
        max-height: 400px;
    }
    
    .stock-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
    }
    
    .stock-card {
        min-height: 50px;
        padding: 6px 8px;
    }
    
    .compact-symbol {
        font-size: 0.8rem;
    }
    
    .compact-price {
        font-size: 0.85rem;
    }
    
    .compact-change {
        font-size: 0.7rem;
    }
    
    .chat-messages {
        height: 200px;
    }
}

/* AI Sidebar Styles */
.ai-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    border-left: 1px solid #262626;
    z-index: 1000;
    transition: right 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
}

.ai-sidebar.open {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #262626;
    background: linear-gradient(135deg, #111111 0%, #1a1a1a 100%);
}

.sidebar-header h3 {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.sidebar-close {
    background: none;
    border: none;
    color: #b0b0b0;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.sidebar-chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
}

.sidebar-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
}

.sidebar-suggestions {
    padding: 16px 20px;
    border-top: 1px solid #1a1a1a;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-input-container {
    display: flex;
    padding: 20px;
    background: linear-gradient(135deg, #111111 0%, #1a1a1a 100%);
    border-top: 1px solid #262626;
    gap: 12px;
}

#sidebarInput {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #262626;
    border-radius: 10px;
    background: #0a0a0a;
    color: #ffffff;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

#sidebarInput:focus {
    outline: none;
    border-color: #00c805;
    background: #111111;
    box-shadow: 0 0 0 3px rgba(0, 200, 5, 0.1);
}

.sidebar-send-btn {
    padding: 12px 16px;
    background: linear-gradient(135deg, #00c805 0%, #00a804 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-send-btn:hover {
    background: linear-gradient(135deg, #00a804 0%, #009603 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 200, 5, 0.3);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* Mobile responsiveness for sidebar */
@media (max-width: 768px) {
    .ai-sidebar {
        width: 100vw;
        right: -100vw;
    }
    
    .ai-sidebar.open {
        right: 0;
    }
}