/* Custom Styles for Stock Terminal */

body {
    font-family: 'Inter', sans-serif;
    background-color: #f3f3fb;
}

/* Enable smooth momentum scrolling on iOS for scrollable containers */
.overflow-y-auto {
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior-y: contain;
    position: relative;
}

.custom-shadow {
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

/* Custom scrollbar for chat sections */
.chat-scroll::-webkit-scrollbar {
    width: 4px;
}

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

.chat-scroll::-webkit-scrollbar-thumb {
    background: #e2e2e2;
    border-radius: 10px;
}

/* Loading spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4f46e5;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

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

/* Additional utility styles */
.duration-btn {
    transition: all 0.2s ease;
}
.duration-btn:hover {
    color: #111;
}
.tab-btn {
    transition: all 0.2s ease;
}
.tab-btn:hover {
    background-color: #f8fafc;
}

/* Price change text (tablet/desktop) */
.price-change-positive { color: #16a34a; font-size: 12px; font-weight: 500; }
.price-change-negative { color: #dc2626; font-size: 12px; font-weight: 500; }

/* Tab bar: scrollable on all screens, invisible scrollbar */
.qx-tab-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    display: flex;
}
.qx-tab-bar::-webkit-scrollbar { display: none; }
.qx-tab-bar .tab-btn { flex-shrink: 0; white-space: nowrap; }

/* Mobile: smaller tab buttons */
@media (max-width: 639px) {
    .qx-tab-bar .tab-btn {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* Metrics grid: 2 columns on mobile */
.grid.grid-cols-2.md\:grid-cols-3.gap-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
}

/* Sidebar detail grid & upgrade modal */
.detail-grid { 
    display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; 
}

.upgrade-plans-grid { 
    display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; 
}

@media (min-width: 1024px) and (max-width: 1223px) {
    #stock-header {
        position: relative;
    }

    #price-block {
        position: absolute;
        top: 1.25rem;
        right: 1.25rem;
        text-align: right;
    }

    #stock-header-right {
        padding-top: 4.5rem; 
    }
}

/* Between 640px–767px (sm but not yet md) */
@media (min-width: 640px) and (max-width: 767px) {
    #stock-header {
        position: relative;
    }
    #price-block {
        position: absolute;
        top: 1.25rem;
        right: 1.25rem;
        text-align: right;
    }
    #stock-header-right {
        padding-top: 3.5rem;
    }
    #price-block .flex {
        justify-content: flex-end;
    }
}

/* Mobile user auth: hide email label at ≤550px, show only Sign Out */
@media (max-width: 550px) {
    .user-email-label {
        display: none !important;
    }
    .user-auth-container {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    .user-auth-container > #logout-btn {
        margin-left: 0 !important;
    }
}
