/**
 * NIFTY Top 8 Styles
 * Compact badge display with expandable panel
 */

/* ============================================================================
   Card Display (Compact) - Inside Overview Card
   ============================================================================ */

.nifty-top8-card-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nifty-top8-summary {
    display: flex;
    justify-content: space-around;
    margin-bottom: 8px;
}

.top8-stat {
    text-align: center;
}

.top8-stat-label {
    font-size: 10px;
    color: #666;
    font-weight: 600;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.top8-stat-value {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.top8-stat-value.gainers {
    color: #2e7d32;
}

.top8-stat-value.losers {
    color: #c62828;
}

.top8-toggle-btn {
    width: 100%;
    padding: 6px 8px;
    background: linear-gradient(135deg, #283593 0%, #3949ab 100%);
    border: none;
    border-radius: 4px;
    color: white;
    font-weight: 600;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 3px rgba(40, 53, 147, 0.3);
}

.top8-toggle-btn:hover {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(40, 53, 147, 0.4);
}

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

/* ============================================================================
   Slide-Out Panel (Right Side)
   ============================================================================ */
.nifty-slideout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

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

.nifty-slideout-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slideout-header {
    background: linear-gradient(135deg, #283593 0%, #3949ab 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #1a237e;
    flex-shrink: 0;
}

.slideout-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slideout-icon {
    font-size: 24px;
}

.slideout-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.slideout-close {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 32px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}

.slideout-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.slideout-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* Scrollbar for slideout body */
.slideout-body::-webkit-scrollbar {
    width: 8px;
}

.slideout-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.slideout-body::-webkit-scrollbar-thumb {
    background: #283593;
    border-radius: 4px;
}

.slideout-body::-webkit-scrollbar-thumb:hover {
    background: #1a237e;
}

/* Slideout Sections */
.slideout-section {
    margin-bottom: 24px;
}

.slideout-section:last-child {
    margin-bottom: 0;
}

.slideout-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border-radius: 8px;
    margin-bottom: 12px;
}

.slideout-section-title {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.slideout-section-count {
    background: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
}

.slideout-stocks-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.slideout-stock-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.slideout-stock-card:hover {
    transform: translateX(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.slideout-stock-card.gainer {
    border-left: 4px solid #4caf50;
    background: linear-gradient(90deg, rgba(76, 175, 80, 0.05) 0%, white 100%);
}

.slideout-stock-card.loser {
    border-left: 4px solid #f44336;
    background: linear-gradient(90deg, rgba(244, 67, 54, 0.05) 0%, white 100%);
}

.slideout-stock-symbol {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    letter-spacing: 0.3px;
}

.slideout-stock-change {
    font-size: 16px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 6px;
}

.slideout-stock-card.gainer .slideout-stock-change {
    color: #2e7d32;
    background: rgba(76, 175, 80, 0.15);
}

.slideout-stock-card.loser .slideout-stock-change {
    color: #c62828;
    background: rgba(244, 67, 54, 0.15);
}

/* Responsive */
@media (max-width: 768px) {
    .nifty-slideout-panel {
        width: 90%;
        max-width: 400px;
    }
}

/* ============================================================================
   No Data State
   ============================================================================ */
.top8-no-data {
    text-align: center;
    padding: 16px;
    color: #999;
    font-size: 13px;
    font-style: italic;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 768px) {
    .top8-stat-value {
        font-size: 18px;
    }
    
    .top8-toggle-btn {
        font-size: 9px;
        padding: 6px;
    }
    
    .nifty-expanded-section {
        margin-top: 10px;
        padding-top: 10px;
    }
    
    .inline-section {
        padding: 8px;
    }
    
    .inline-stock-item {
        padding: 5px 6px;
        font-size: 10px;
    }
}

/* ============================================================================
   Loading State
   ============================================================================ */

.top8-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #999;
    font-size: 12px;
}

.top8-loading::before {
    content: "⏳";
    margin-right: 8px;
    animation: pulse 1.5s ease-in-out infinite;
}

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

