/* Insanity Markets - Main Stylesheet */
/* Full control over all styling - no more Streamlit limitations! */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* Removed background - now using image from base.html */
    /* background: linear-gradient(135deg, #0c0c0c 0%, #1a1a1a 100%); */
    color: #e0e0e0;
    min-height: 100vh;
    line-height: 1.6;
}

/* Header & Navigation */
.header {
    /* Background now set in base.html with transparency */
    /* background: linear-gradient(90deg, #1a1a1a 0%, #2a2a2a 100%); */
    padding: 1rem 0;
    border-bottom: 3px solid #f6c344;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.nav-container {
    /* Styles now in base.html */
    /* display: flex;
    justify-content: space-between;
    align-items: center; */
}

.logo {
    /* Styles now in base.html */
    /* color: #f6c344;
    font-size: 1.8rem;
    font-weight: 800;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.5rem; */
}

.logo-icon {
    /* Size now set in base.html */
    /* width: 80px;
    height: 80px; */
    /* Removed drop-shadow, animation, and border-radius */
    transition: transform 0.3s ease;
}

.logo-text {
    transition: all 0.3s ease;
}

.logo:hover .logo-icon {
    transform: scale(1.1);
    /* Removed drop-shadow on hover */
}

.logo:hover .logo-text {
    color: #fff;
}

@keyframes subtle-glow {
    0% { filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); }
    100% { filter: drop-shadow(0 2px 6px rgba(246, 195, 68, 0.2)); }
}

.nav-menu {
    /* Styles now in base.html */
    /* display: flex;
    list-style: none;
    gap: 2rem; */
}

.nav-link {
    color: #e0e0e0;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background: #f6c344;
    color: #1a1a1a;
    transform: translateY(-2px);
}

/* Main Content */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 120px);
}

.page-title {
    text-align: center;
    color: #f6c344;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* Data Quality Banner */
.data-quality-banner {
    background: linear-gradient(90deg, #1a1a1a 0%, #2a2a2a 100%);
    padding: 1rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.quality-header {
    color: #f6c344;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.quality-stats {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: #999;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Panel Styling */
.panel {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 2px solid #3a3a3a;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
}

.panel:hover {
    transform: translateY(-5px);
    border-color: #f6c344;
    box-shadow: 0 8px 25px rgba(246,195,68,0.2);
}

.panel-header {
    background: linear-gradient(90deg, #2a2a2a 0%, #3a3a3a 100%);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid #4a4a4a;
}

.panel-icon {
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(246,195,68,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.panel-icon.price-up {
    color: #4caf50;
    background: rgba(76,175,80,0.2);
}

.panel-icon.price-down {
    color: #f44336;
    background: rgba(244,67,54,0.2);
}

.panel-title {
    color: #f6c344;
    font-weight: 600;
    font-size: 1.2rem;
    flex: 1;
}

.panel-content {
    padding: 1rem;
}

/* Item Lists */
.item-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.item-card {
    background: #2a2a2a;
    border: 1px solid #4a4a4a;
    border-radius: 8px;
    padding: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.item-card:hover {
    background: #3a3a3a;
    border-color: #f6c344;
    transform: translateX(5px);
}

.item-icon {
    width: 40px;
    height: 40px;
    background: #f6c344;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #1a1a1a;
    font-weight: bold;
}

.item-info {
    flex: 1;
}

.item-name {
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.3rem;
}

.item-price {
    color: #f6c344;
    font-size: 0.9rem;
}

.item-change {
    text-align: right;
    font-weight: 700;
    font-size: 1.1rem;
}

.price-up {
    color: #4caf50;
}

.price-down {
    color: #f44336;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: #f6c344;
    color: #1a1a1a;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn:hover {
    background: #ffdd55;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(246,195,68,0.3);
}

.btn-secondary {
    background: #3a3a3a;
    color: #e0e0e0;
}

.btn-secondary:hover {
    background: #4a4a4a;
}

/* Search */
.search-container {
    max-width: 600px;
    margin: 2rem auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem;
    background: #2a2a2a;
    border: 2px solid #3a3a3a;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #f6c344;
    box-shadow: 0 0 0 3px rgba(246,195,68,0.2);
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #2a2a2a;
    border: 2px solid #3a3a3a;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.autocomplete-item {
    padding: 0.8rem;
    cursor: pointer;
    border-bottom: 1px solid #3a3a3a;
    transition: background 0.2s ease;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background: #3a3a3a;
    color: #f6c344;
}

/* Footer */
.footer {
    background: #1a1a1a;
    border-top: 2px solid #3a3a3a;
    padding: 2rem 0;
    text-align: center;
    color: #999;
    margin-top: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Nav container styles now in base.html */
    /* .nav-container {
        flex-direction: column;
        gap: 1rem;
    } */
    
    /* Nav menu styles now in base.html */
    /* .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    } */
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .quality-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
}

/* Loading States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    color: #f6c344;
    font-size: 1.1rem;
}

.loading::after {
    content: '...';
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.empty-state-hint {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Hero Banner */
.hero-banner {
    width: 100%;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.hero-image {
    width: 100%;
    position: relative;
    display: inline-block;
}

.hero-img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 350px;
    object-fit: contain;
    object-position: center;
}

/* Responsive hero banner */
@media (min-width: 1200px) {
    .hero-img {
        max-height: 400px;
    }
}

/* Data Quality Overlay on Hero Banner */
.data-quality-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 25%;
    background: linear-gradient(to bottom, rgba(26, 26, 26, 0.7), rgba(26, 26, 26, 0.95));
    border-top: 1px solid rgba(246, 195, 68, 0.3);
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.data-quality-overlay .quality-header {
    color: #4caf50;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}

.data-quality-overlay .quality-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    font-size: 0.8rem;
    color: #ccc;
    text-align: center;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}

.data-quality-overlay .quality-stats span {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .hero-banner {
        margin-bottom: 0;
        position: relative;
    }
    
    .hero-img {
        max-height: 300px;
        width: 100%;
        object-fit: cover;
    }
    
    .data-quality-overlay {
        position: static;
        height: auto;
        padding: 1rem;
        background: linear-gradient(90deg, #1a1a1a, #2a2a2a);
        border-top: 2px solid #f6c344;
        border-bottom: 1px solid #3a3a3a;
        margin-bottom: 1rem;
    }
    
    .data-quality-overlay .quality-header {
        font-size: 1rem;
        margin-bottom: 0.75rem;
        color: #f6c344;
    }
    
    .data-quality-overlay .quality-stats {
        font-size: 0.85rem;
        gap: 0.5rem;
        flex-direction: column;
        line-height: 1.5;
    }
    
    .data-quality-overlay .quality-stats span {
        display: block;
        white-space: normal;
        word-wrap: break-word;
        padding: 0.25rem 0;
    }
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Ticker Bar Styles */
.ticker-container {
    background: linear-gradient(90deg, #1a1a1a, #2a2a2a);
    border-bottom: 1px solid #3a3a3a;
    display: flex;
    align-items: center;
    height: 40px;
    overflow: hidden;
    position: relative;
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
}

.ticker-label {
    background: #f6c344;
    color: #000;
    padding: 0 15px;
    height: 100%;
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 2;
    box-shadow: 2px 0 4px rgba(0,0,0,0.3);
}

.ticker-icon {
    margin-right: 6px;
}

.ticker-wrapper {
    flex: 1;
    overflow: hidden;
    height: 100%;
}

.ticker-content {
    display: flex;
    align-items: center;
    height: 100%;
    animation: ticker-scroll 60s linear infinite;
    white-space: nowrap;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    padding: 0 25px;
    height: 100%;
    border-right: 1px solid #3a3a3a;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    min-width: 280px;
    flex-shrink: 0;
}

.ticker-item:hover {
    background: rgba(246, 195, 68, 0.1);
}

.ticker-name {
    color: #f6c344;
    font-weight: 500;
    margin-right: 10px;
    font-size: 0.9rem;
    max-width: 140px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0;
}

.ticker-price {
    font-weight: 600;
    margin-right: 10px;
    font-size: 0.85rem;
}

.ticker-price-up {
    color: #4caf50; /* Green for upward trend */
}

.ticker-price-down {
    color: #f44336; /* Red for downward trend */
}

.ticker-price-stable {
    color: #2196f3; /* Blue for stable trend */
}

.ticker-meta {
    color: #999;
    font-size: 0.75rem;
}

@keyframes ticker-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Pause animation on hover */
.ticker-container:hover .ticker-content {
    animation-play-state: paused;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .ticker-container {
        height: 35px;
    }
    
    .ticker-label {
        padding: 0 15px;
        font-size: 0.85rem;
    }
    
    .ticker-item {
        min-width: 240px;
        padding: 0 20px;
    }
    
    .ticker-name {
        font-size: 0.85rem;
        max-width: 120px;
    }
    
    .ticker-price {
        font-size: 0.8rem;
    }
    
    .ticker-meta {
        font-size: 0.75rem;
    }
}