/* ========================================
   DISCOVER PAGE - MATCHED TO APP DESIGN
   ======================================== */

/* Import app theme variables */
@import url('styles.css');

/* Override with consistent typography */
.discover-container h2 {
    font-size: 16px !important;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

.discover-container p,
.briefing-content,
.news-description,
.sotd-ai-summary {
    font-size: 14px !important;
    line-height: 1.6;
    color: var(--text-medium);
}

.index-price,
.mover-price,
.sotd-price,
.fg-score {
    font-size: 18px !important;
    font-weight: 700;
}

.briefing-header h1 {
    font-size: 16px !important;
}

/* ========================================
   FEAR & GREED INDEX - COMPACT VERSION
   ======================================== */

.fear-greed-section-compact {
    margin-bottom: 24px;
}

.fear-greed-card-compact {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.fg-score-compact {
    font-size: 48px !important;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.fg-sentiment {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.fg-gauge {
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, 
        #dc2626 0%, 
        #ef4444 25%, 
        #64748b 50%, 
        #10b981 75%, 
        #059669 100%
    );
    border-radius: 4px;
    position: relative;
    margin-bottom: 8px;
}

.fg-indicator {
    position: absolute;
    top: -6px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 10px solid var(--text);
    transform: translateX(-50%);
}

.fg-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-light);
}

/* ========================================
   STOCK OF THE DAY - FULL WIDTH VERSION
   ======================================== */

.stock-of-day-section-full {
    margin-bottom: 32px;
}

.stock-of-day-card-full {
    background: var(--bg-elevated);
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 0;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.sotd-full-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 0;
    padding: 0;
}

/* Left Column - Ticker & CTA */
.sotd-left {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 32px 24px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(168, 85, 247, 0.05));
    border-right: 1px solid var(--border);
}

.sotd-ticker-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.sotd-ticker-link {
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
}

.sotd-ticker-link:hover {
    transform: scale(1.05);
}

.sotd-ticker-large {
    font-size: 48px;
    font-weight: 800;
    color: var(--primary);
    cursor: pointer;
    display: block;
    text-align: center;
    letter-spacing: 2px;
}

.sotd-price-centered {
    font-size: 32px !important;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    text-align: center;
}

.sotd-change-centered {
    font-size: 24px !important;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sotd-change-centered.positive {
    color: var(--gain);
}

.sotd-change-centered.negative {
    color: var(--loss);
}

.sotd-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.sotd-metric {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
}

.sotd-metric-label {
    display: block;
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sotd-metric-value {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.sotd-metric-value.highlight {
    color: var(--accent);
}

.sotd-cta {
    width: 100%;
    margin-top: 8px;
}

.sotd-cta-button {
    display: block;
    width: 100%;
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 700;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.sotd-cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.sotd-cta-hint {
    display: block;
    font-size: 11px;
    font-weight: 500;
    opacity: 0.95;
    margin-top: 6px;
    letter-spacing: 0.3px;
}

/* Right Column - AI Summary */
.sotd-right {
    background: var(--bg-elevated);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    justify-content: center;
}

.sotd-ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    align-self: flex-start;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.sotd-ai-summary {
    font-size: 15px !important;
    line-height: 1.8;
    color: var(--text-medium);
}

.sotd-ai-summary strong {
    color: var(--primary);
    font-weight: 700;
}

.sotd-ai-summary p {
    margin-bottom: 14px;
}

.sotd-ai-summary p:last-child {
    margin-bottom: 0;
}

.sotd-reason-tag {
    padding: 18px 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-medium);
}

.sotd-reason-tag strong {
    color: var(--accent);
    display: block;
    margin-bottom: 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

/* ========================================
   ENGAGEMENT HEADER (Streak + Market Score)
   ======================================== */

.engagement-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 24px;
}

.streak-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: white;
    padding: 14px 28px;
    border-radius: 30px;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
    animation: streakPulse 2s ease-in-out infinite;
}

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

.streak-icon {
    font-size: 24px;
    animation: streakFlicker 1.5s ease-in-out infinite;
}

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

.streak-text {
    font-size: 15px;
    font-weight: 600;
}

.streak-text strong {
    font-size: 20px;
    font-weight: 800;
}

.market-score-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    padding: 12px 20px;
    border-radius: 30px;
    box-shadow: var(--shadow);
}

.market-score-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
}

.market-score-value {
    display: flex;
    align-items: center;
    gap: 8px;
}

.market-score-value #marketScoreNumber {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
}

.market-score-value #marketScoreSentiment {
    font-size: 13px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
}

.market-score-value #marketScoreSentiment.bullish {
    background: #d1fae5;
    color: #065f46;
}

.market-score-value #marketScoreSentiment.bearish {
    background: #fee2e2;
    color: #991b1b;
}

.market-score-value #marketScoreSentiment.neutral {
    background: var(--bg);
    color: var(--text-medium);
}

@media (max-width: 640px) {
    .engagement-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .market-score-badge {
        justify-content: space-between;
    }
}

/* ========================================
   INDEX CARDS WITH SPARKLINES
   ======================================== */

/* Market Indices Grid */
.indices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.index-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.index-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.index-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-medium);
    margin-bottom: 8px;
}

.index-price {
    font-size: 24px !important;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.index-change {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.index-sparkline-container {
    height: 60px;
    margin-top: 12px;
    position: relative;
}

.index-sparkline {
    width: 100%;
    height: 100%;
    display: block;
}

@media (max-width: 768px) {
    .indices-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .index-card {
        padding: 16px;
    }
    
    .index-price {
        font-size: 20px !important;
    }
    
    .index-sparkline-container {
        height: 50px;
    }
}

.index-sparkline-loading {
    height: 50px;
    background: linear-gradient(90deg, var(--bg) 25%, var(--bg-elevated) 50%, var(--bg) 75%);
    background-size: 200% 100%;
    animation: sparklineLoading 1.5s infinite;
    border-radius: 4px;
    margin-top: 16px;
}

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

/* ========================================
   EARNINGS CALENDAR
   ======================================== */

.calendar-section {
    margin-bottom: 32px;
}

.calendar-grid {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.calendar-nav-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.calendar-nav-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.calendar-nav-btn:disabled {
    background: var(--border);
    color: var(--text-light);
    cursor: not-allowed;
    opacity: 0.5;
}

.calendar-month-selector {
    flex: 1;
    text-align: center;
}

.calendar-month-selector select {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    min-width: 200px;
    transition: all 0.2s;
}

.calendar-month-selector select:hover {
    border-color: var(--primary);
}

.calendar-month-selector select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.calendar-display {
    width: 100%;
}

.calendar-month {
    min-width: 0;
    max-width: 800px;
    margin: 0 auto;
}

.month-header {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-align: center;
}

.weekday-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.weekday-header div {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
    padding: 8px 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    background: var(--bg-primary);
    transition: all 0.2s;
}

.calendar-day.empty {
    background: transparent;
    border-color: transparent;
}

.calendar-day.past {
    opacity: 0.4;
}

.calendar-day.today {
    border-color: var(--primary);
    border-width: 2px;
    background: rgba(37, 99, 235, 0.05);
}

.calendar-day.has-earnings {
    background: rgba(37, 99, 235, 0.08);
    border-color: var(--primary);
    cursor: pointer;
}

.calendar-day.has-earnings:hover {
    background: rgba(37, 99, 235, 0.15);
    transform: scale(1.05);
    z-index: 10;
    box-shadow: var(--shadow-md);
}

.calendar-day.has-earnings:active {
    transform: scale(0.98);
}

.day-number {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.earnings-badges {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    align-items: center;
}

.earning-badge {
    background: var(--primary);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 100%;
    pointer-events: none;
}

.earning-more {
    font-size: 8px;
    color: var(--text-light);
    font-weight: 600;
    pointer-events: none;
}

/* Earnings Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.earnings-modal {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.earnings-modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.earnings-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.earnings-modal-content {
    padding: 20px 24px;
    overflow-y: auto;
}

.earnings-modal-subtitle {
    margin: 0 0 16px 0;
    font-size: 13px;
    color: var(--text-medium);
}

.earnings-modal-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.earnings-modal-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.earnings-modal-item:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
    transform: translateX(4px);
}

.earnings-modal-item:active {
    transform: scale(0.98);
}

.earnings-modal-item-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.earnings-modal-ticker {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.earnings-modal-time {
    font-size: 12px;
    color: var(--text-medium);
}

.earnings-modal-item-right {
    color: var(--text-light);
    font-size: 20px;
}

.earnings-modal-arrow {
    transition: transform 0.2s;
}

.earnings-modal-item:hover .earnings-modal-arrow {
    transform: translateX(4px);
}

/* Responsive calendar */
@media (max-width: 768px) {
    .calendar-navigation {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }
    
    .calendar-month-selector {
        width: 100%;
    }
    
    .calendar-month-selector select {
        width: 100%;
        min-width: auto;
    }
    
    .calendar-nav-btn {
        width: 48%;
    }
    
    .calendar-navigation {
        display: grid;
        grid-template-areas: 
            "selector selector"
            "prev next";
        grid-template-columns: 1fr 1fr;
    }
    
    .calendar-month-selector {
        grid-area: selector;
    }
    
    #prevMonthBtn {
        grid-area: prev;
    }
    
    #nextMonthBtn {
        grid-area: next;
    }
    
    .calendar-day {
        padding: 4px;
    }
    
    .day-number {
        font-size: 11px;
    }
    
    .earning-badge {
        font-size: 8px;
        padding: 1px 3px;
    }
    
    /* Modal responsive */
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    
    .earnings-modal {
        max-width: 100%;
        max-height: 85vh;
        border-radius: 16px 16px 0 0;
        animation: slideUpMobile 0.3s ease;
    }
    
    @keyframes slideUpMobile {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
    
    .earnings-modal-header {
        padding: 20px;
    }
    
    .earnings-modal-header h3 {
        font-size: 16px;
    }
    
    .earnings-modal-content {
        padding: 16px 20px;
    }
    
    .earnings-modal-item {
        padding: 14px;
    }
}

/* ========================================
   ACHIEVEMENT BADGES
   ======================================== */

.achievements-section, .achievements-section-compact {
    margin-bottom: 32px;
    padding: 24px;
    background: var(--bg-elevated);
    border-radius: 16px;
    border: 1px solid var(--border);
}

.achievements-section h2, .achievements-section-compact h2 {
    margin-bottom: 24px;
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Achievements Teaser (for non-logged-in users) - COMPACT & CENTERED */
.achievements-teaser {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 20px;
    flex-wrap: wrap;
    max-width: 1000px;
    margin: 0 auto;
}

.teaser-header {
    flex: 0 0 auto;
    text-align: left;
    min-width: 180px;
}

.teaser-header h3 {
    margin: 0 0 2px 0 !important;
    font-size: 16px !important;
}

.teaser-header p {
    margin: 0 !important;
    font-size: 12px !important;
    line-height: 1.3;
    color: var(--text-light);
}

.teaser-badges {
    display: flex;
    gap: 10px;
    flex: 0 0 auto;
    justify-content: center;
}

.teaser-badge {
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 10px 8px;
    text-align: center;
    transition: all 0.3s;
    width: 85px;
    flex-shrink: 0;
}

.teaser-badge.locked {
    opacity: 0.5;
    filter: grayscale(80%);
    position: relative;
}

.teaser-badge.locked::after {
    content: '🔒';
    position: absolute;
    top: 3px;
    right: 3px;
    font-size: 12px;
    opacity: 0.7;
}

.teaser-badge:hover {
    transform: translateY(-2px);
    opacity: 0.7;
}

.badge-icon {
    font-size: 28px;
    margin-bottom: 4px;
}

.badge-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.badge-desc {
    font-size: 10px;
    color: var(--text-light);
    line-height: 1.2;
}

.teaser-cta {
    flex: 0 0 auto;
    text-align: center;
}

.teaser-cta > div:first-child {
    display: none;
}

.teaser-cta > div:last-child {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
}

.teaser-cta button {
    white-space: nowrap;
    padding: 10px 16px;
    font-size: 13px;
    min-width: auto;
}

/* Tablet - slight adjustment */
@media (max-width: 1024px) {
    .achievements-teaser {
        max-width: 900px;
        gap: 12px;
    }
    
    .teaser-header {
        min-width: 160px;
    }
    
    .teaser-badges {
        gap: 8px;
    }
    
    .teaser-badge {
        width: 75px;
        padding: 8px 6px;
    }
}

/* Mobile - compact single column */
@media (max-width: 768px) {
    .achievements-teaser {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        padding: 16px;
        max-width: 100%;
    }
    
    .teaser-header {
        text-align: center;
        min-width: auto;
    }
    
    .teaser-header h3 {
        font-size: 15px !important;
    }
    
    .teaser-header p {
        font-size: 11px !important;
    }
    
    .teaser-badges {
        gap: 8px;
        width: 100%;
        max-width: 400px;
    }
    
    .teaser-badge {
        flex: 1;
        min-width: 70px;
        width: auto;
        padding: 10px 6px;
    }
    
    .badge-icon {
        font-size: 26px;
    }
    
    .badge-name {
        font-size: 11px;
    }
    
    .badge-desc {
        font-size: 9px;
    }
    
    .teaser-cta {
        width: 100%;
        max-width: 400px;
    }
    
    .teaser-cta > div:last-child {
        flex-direction: row;
        gap: 8px;
        width: 100%;
    }
    
    .teaser-cta button {
        flex: 1;
        min-width: 0;
        padding: 10px 12px;
    }
}

/* Extra small mobile */
@media (max-width: 375px) {
    .teaser-badges {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .teaser-badge {
        flex: 0 0 calc(50% - 4px);
        max-width: 150px;
    }
    
    .teaser-cta > div:last-child {
        flex-direction: column;
        gap: 8px;
    }
    
    .teaser-cta button {
        width: 100%;
    }
}

/* Compact tier widget for Discover page - HORIZONTAL LAYOUT */
.current-tier-widget {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    flex-wrap: wrap;
}

.current-tier-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.tier-badge-large {
    display: inline-block;
    white-space: nowrap;
}

.tier-progress-text {
    white-space: nowrap;
}

.next-tier-preview {
    flex: 1 1 300px;
    margin: 0;
    min-width: 250px;
}

.current-tier-widget > a {
    flex: 0 0 auto;
    margin: 0 !important;
    white-space: nowrap;
}

/* Mobile - stack vertically on small screens */
@media (max-width: 640px) {
    .current-tier-widget {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .current-tier-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .next-tier-preview {
        width: 100%;
    }
    
    .current-tier-widget > a {
        width: 100%;
    }
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.achievement-item {
    background: var(--bg-elevated);
    border: 3px solid var(--border);
    border-radius: 16px;
    padding: 20px 16px;
    text-align: center;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Tier-specific colors */
.achievement-item.tier-bronze {
    border-color: #cd7f32;
}

.achievement-item.tier-silver {
    border-color: #C0C0C0;
}

.achievement-item.tier-gold {
    border-color: #FFD700;
}

.achievement-item.tier-platinum {
    border-color: #E5E4E2;
}

.achievement-item.tier-diamond {
    border-color: #b9f2ff;
}

.achievement-item.tier-legendary {
    border-color: #FF6B6B;
}

.achievement-item.unlocked {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.achievement-item.unlocked.tier-bronze {
    box-shadow: 0 8px 24px rgba(205, 127, 50, 0.4);
}

.achievement-item.unlocked.tier-silver {
    box-shadow: 0 8px 24px rgba(192, 192, 192, 0.4);
}

.achievement-item.unlocked.tier-gold {
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.5);
}

.achievement-item.unlocked.tier-platinum {
    box-shadow: 0 8px 24px rgba(229, 228, 226, 0.4);
}

.achievement-item.unlocked.tier-diamond {
    box-shadow: 0 8px 24px rgba(0, 191, 255, 0.5);
}

.achievement-item.unlocked.tier-legendary {
    box-shadow: 0 8px 24px rgba(255, 107, 107, 0.5);
    animation: legendary-glow 2s ease-in-out infinite;
}

@keyframes legendary-glow {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(255, 107, 107, 0.5);
    }
    50% {
        box-shadow: 0 8px 32px rgba(255, 107, 107, 0.8);
    }
}

.achievement-item.locked {
    opacity: 0.6;
    filter: grayscale(80%);
}

.achievement-item:hover {
    transform: translateY(-4px);
}

.achievement-tier-badge {
    margin-bottom: 12px;
}

.achievement-icon {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}

.achievement-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    margin-top: 8px;
}

.achievement-description {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 12px;
}

.achievement-progress-info {
    width: 100%;
    margin-top: auto;
}

.progress-text {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
}

.achievement-progress {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
}

.achievement-progress-bar {
    height: 100%;
    transition: width 0.8s ease;
    border-radius: 3px;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 968px) {
    .sotd-full-layout {
        grid-template-columns: 1fr;
    }
    
    .sotd-left {
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 24px;
    }
    
    .sotd-right {
        padding: 24px;
    }
    
    .fear-greed-card-compact {
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .sotd-ticker-large {
        font-size: 36px;
    }
    
    .sotd-price-centered {
        font-size: 26px !important;
    }
    
    .sotd-change-centered {
        font-size: 20px !important;
    }
    
    .sotd-left {
        padding: 20px;
    }
    
    .sotd-right {
        padding: 20px;
    }
}

/* ========================================
   SECTOR PERFORMANCE HEATMAP
   ======================================== */

/* Sector grid (main content - takes majority of space) */
/* Fixed 3-column grid for symmetry (3 sectors on top, 3 on bottom) */
.sector-heatmap-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.sector-heatmap-card {
    padding: 24px;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
}

.sector-heatmap-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Heatmap Background Colors with Gradients */
.sector-heatmap-card.strong-positive {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.sector-heatmap-card.positive {
    background: linear-gradient(135deg, #34d399, #10b981);
    color: white;
}

.sector-heatmap-card.neutral {
    background: linear-gradient(135deg, #64748b, #475569);
    color: white;
}

.sector-heatmap-card.negative {
    background: linear-gradient(135deg, #f87171, #ef4444);
    color: white;
}

.sector-heatmap-card.strong-negative {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
}

.sector-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    opacity: 0.95;
}

.sector-change {
    font-size: 24px;
    font-weight: 700;
    opacity: 1;
}

/* Legend (small footer - below the cards) */
.sector-heatmap-legend {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 12px;
    margin-top: 8px;
}

.legend-title {
    font-size: 12px !important;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-medium);
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-medium);
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-color.strong-positive { background: linear-gradient(135deg, #10b981, #059669); }
.legend-color.positive { background: linear-gradient(135deg, #34d399, #10b981); }
.legend-color.neutral { background: linear-gradient(135deg, #64748b, #475569); }
.legend-color.negative { background: linear-gradient(135deg, #f87171, #ef4444); }
.legend-color.strong-negative { background: linear-gradient(135deg, #dc2626, #b91c1c); }

@media (max-width: 768px) {
    .sector-heatmap-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .sector-heatmap-card {
        padding: 18px;
        min-height: 100px;
    }
    
    .sector-name {
        font-size: 13px;
    }
    
    .sector-change {
        font-size: 20px;
    }
    
    .legend-items {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* ========================================
   TOP MOVERS
   ======================================== */

.movers-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: var(--bg);
    border-color: var(--primary);
}

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

.movers-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mover-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.mover-item:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}

.mover-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mover-rank {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-medium);
    min-width: 20px;
}

.mover-ticker {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
}

.mover-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mover-price {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.mover-change {
    font-size: 14px;
    font-weight: 600;
    min-width: 80px;
    text-align: right;
}

.mover-change.positive {
    color: #10b981;
}

.mover-change.negative {
    color: #ef4444;
}

/* ========================================
   MARKET NEWS
   ======================================== */

.news-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.news-item:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}

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

.news-source {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}

.news-time {
    font-size: 11px;
    color: var(--text-light);
}

.news-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.4;
}

.news-description {
    font-size: 13px;
    color: var(--text-medium);
    line-height: 1.5;
    margin-bottom: 10px;
}

.news-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.news-tag {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.news-tag.sentiment-positive {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.news-tag.sentiment-negative {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.news-tag.sentiment-neutral {
    background: rgba(100, 116, 139, 0.15);
    color: #64748b;
}

.news-tag.ticker-tag {
    background: rgba(37, 99, 235, 0.15);
    color: var(--primary);
}

@media (max-width: 768px) {
    .mover-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .mover-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .news-item {
        padding: 14px;
    }
    
    .news-title {
        font-size: 14px;
    }
}

/* ========================================
   MOBILE OPTIMIZATION (320-375px devices)
   iPhone SE, Small Androids
   ======================================== */

@media (max-width: 375px) {
    /* Minimum font size for body text - 14px */
    body {
        font-size: 14px;
    }
    
    /* Compact sections */
    .discover-container {
        padding: 12px;
    }
    
    section {
        padding: 16px 12px;
    }
    
    h2 {
        font-size: 18px !important;
    }
    
    h3 {
        font-size: 16px !important;
    }
    
    p, .achievement-description, .news-description {
        font-size: 14px !important;
    }
    
    /* Touch-friendly buttons - minimum 44x44px */
    button, .btn, .nav-link, .tab-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .info-icon {
        min-width: 44px;
        min-height: 44px;
        font-size: 16px;
        padding: 10px;
    }
    
    .modal-close-btn, .modal-close {
        min-width: 44px;
        min-height: 44px;
        font-size: 20px;
    }
    
    .calendar-nav-btn {
        min-width: 44px;
        min-height: 44px;
        font-size: 16px;
        padding: 10px;
    }
    
    /* Table overflow fix - horizontal scroll with indicators */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
        box-shadow: inset -20px 0 20px -20px rgba(0,0,0,0.3);
    }
    
    table {
        font-size: 14px;
        min-width: 100%;
    }
    
    th, td {
        padding: 12px 10px;
        font-size: 14px;
        white-space: nowrap;
    }
    
    /* Compact grids for small screens */
    .indices-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
    
    .sector-heatmap-grid {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }
    
    .achievements-grid, .profile-achievements-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    
    /* Larger touch targets for interactive cards */
    .calendar-day {
        min-height: 44px;
        font-size: 14px;
        padding: 8px;
    }
    
    .earnings-modal-item {
        padding: 16px;
        min-height: 60px;
    }
    
    .mover-item {
        padding: 16px;
        min-height: 60px;
    }
    
    .news-item {
        padding: 16px;
        min-height: 80px;
    }
    
    /* Stock of the day - larger text */
    .sotd-ticker-large {
        font-size: 28px !important;
    }
    
    .sotd-price-centered {
        font-size: 22px !important;
    }
    
    /* Better spacing for readability */
    .briefing-content {
        font-size: 14px !important;
        line-height: 1.7;
    }
    
    /* Index cards - single column */
    .index-card {
        padding: 16px;
    }
    
    .index-name {
        font-size: 14px;
    }
    
    .index-price {
        font-size: 20px;
    }
    
    .index-change {
        font-size: 14px;
    }
    
    /* Modal improvements */
    .modal, .earnings-modal {
        width: 95%;
        max-width: none;
        padding: 20px;
    }
    
    .form-input, .form-label {
        font-size: 14px;
    }
    
    /* Achievement cards */
    .achievement-item {
        padding: 16px 12px;
    }
    
    .achievement-icon {
        font-size: 40px;
    }
    
    .achievement-name {
        font-size: 14px;
    }
    
    /* Sector heatmap cards */
    .sector-heatmap-card {
        padding: 16px;
        min-height: 80px;
    }
    
    .sector-name {
        font-size: 14px;
    }
    
    .sector-change {
        font-size: 16px;
    }
}

/* Extra small devices (320px width - iPhone SE) */
@media (max-width: 320px) {
    .discover-container {
        padding: 8px;
    }
    
    section {
        padding: 12px 8px;
    }
    
    h2 {
        font-size: 16px !important;
    }
    
    .sector-heatmap-card, .index-card, .achievement-item {
        padding: 12px;
    }
    
    button, .btn {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .current-tier-widget {
        padding: 12px;
    }
    
    .tier-badge-large {
        font-size: 14px !important;
        padding: 8px 16px !important;
    }
}

