/* Daily Minutes Prediction Market - Polymarket-inspired styling */

:root {
    --pm-primary: #6366f1;
    --pm-primary-dark: #4f46e5;
    --pm-secondary: #8b5cf6;
    --pm-accent: #ec4899;
    --pm-success: #10b981;
    --pm-danger: #ef4444;
    --pm-warning: #f59e0b;
    --pm-bg-dark: #0f172a;
    --pm-bg-card: #1e293b;
    --pm-bg-card-hover: #334155;
    --pm-text-primary: #f1f5f9;
    --pm-text-secondary: #94a3b8;
    --pm-border: #334155;
    --pm-border-light: #475569;
    --pm-gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --pm-gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --pm-gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --pm-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --pm-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --pm-anim-fast: 150ms;
    --pm-anim-normal: 260ms;
    --pm-anim-slow: 420ms;
    --pm-anim-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Hero Section */
.top-view {
    background: var(--pm-gradient-1);
    padding: 3rem 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: var(--pm-shadow-lg);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2rem;
    justify-content: space-between;
}

.top-view::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

@keyframes softPop {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }
    60% {
        transform: scale(1.03);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes clickPop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.96);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes rippleGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.65);
    }
    100% {
        box-shadow: 0 0 0 14px rgba(99, 102, 241, 0);
    }
}

@keyframes slideFadeInUpStrong {
    0% {
        opacity: 0;
        transform: translateY(18px) scale(0.96);
    }
    60% {
        opacity: 1;
        transform: translateY(-2px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes iconWiggle {
    0% {
        transform: translateX(0) scale(1);
    }
    25% {
        transform: translateX(-1px) rotate(-2deg) scale(1.03);
    }
    50% {
        transform: translateX(1px) rotate(2deg) scale(1.05);
    }
    75% {
        transform: translateX(-0.5px) rotate(-1deg) scale(1.04);
    }
    100% {
        transform: translateX(0) rotate(0deg) scale(1.05);
    }
}

.this-view-title {
    color: var(--pm-text-primary);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.top-view p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 800px;
    position: relative;
    z-index: 1;
}

/* Points Display */
.dm-points-display {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    position: relative;
    z-index: 1;
    min-width: 250px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.points-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.points-value {
    color: #ffffff;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-shadow: 0 2px 8px rgba(99, 102, 241, 0.5);
    transition: all 0.3s ease;
}

.points-value.points-low {
    color: var(--pm-warning);
    animation: warningPulse 2s ease-in-out infinite;
}

.points-value.points-zero {
    color: var(--pm-danger);
    animation: dangerPulse 1.5s ease-in-out infinite;
}

@keyframes warningPulse {
    0%, 100% { 
        transform: scale(1);
        text-shadow: 0 2px 8px rgba(245, 158, 11, 0.5);
    }
    50% { 
        transform: scale(1.05);
        text-shadow: 0 4px 16px rgba(245, 158, 11, 0.8);
    }
}

@keyframes dangerPulse {
    0%, 100% { 
        transform: scale(1);
        text-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
    }
    50% { 
        transform: scale(1.08);
        text-shadow: 0 4px 20px rgba(239, 68, 68, 1);
    }
}

.points-help-text {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    font-style: italic;
}

/* Tab Navigation */
.tab-navigation {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.tab-btn {
    background: var(--pm-bg-card);
    border: 2px solid var(--pm-border);
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--pm-gradient-1);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.tab-btn:hover {
    transform: translateY(-4px);
    border-color: var(--pm-primary);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.tab-btn:hover::before {
    opacity: 0.1;
}

.tab-btn.active {
    border-color: var(--pm-primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.tab-btn.active::before {
    opacity: 0.15;
}

.tab-icon {
    font-size: 2.5rem;
    line-height: 1;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    filter: grayscale(0.3);
    transition: all 0.3s ease;
}

.tab-btn.active .tab-icon {
    filter: grayscale(0);
    animation: iconWiggle 0.7s ease-out;
}

.tab-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.tab-content h3 {
    color: var(--pm-text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    transition: color 0.3s ease;
}

.tab-btn.active .tab-content h3 {
    color: var(--pm-primary);
}

.tab-preview {
    color: var(--pm-text-secondary);
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Tab Sections */
.tab-section {
    display: none;
}

.tab-section.active {
    display: block;
    animation: fadeInUp 0.35s var(--pm-anim-ease);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Content Cards */
.this-view-card {
    background: var(--pm-bg-card);
    border: 1px solid var(--pm-border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--pm-shadow);
    transition: all 0.3s ease;
}

.this-view-card:hover {
    border-color: var(--pm-border-light);
    box-shadow: var(--pm-shadow-lg);
    transform: translateY(-2px);
}

.this-view-card h2 {
    color: var(--pm-text-primary);
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--pm-primary);
}

.this-view-card h3 {
    color: var(--pm-text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

/* List Grid - Market Cards */
.list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.5rem;
}

/* Market Card - Polymarket Style */
.market-card {
    background: var(--pm-bg-card);
    border: 1px solid var(--pm-border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.market-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--pm-gradient-1);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.market-card:hover {
    transform: translateY(-4px);
    border-color: var(--pm-primary);
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.35);
}

.market-card.closed {
    opacity: 0.7;
    cursor: not-allowed;
}

.market-card.closed:hover {
    transform: none;
    border-color: var(--pm-border);
}

.market-card.has-stakes {
    border-color: var(--pm-success);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, var(--pm-bg-card) 100%);
}

/* Market Card Header */
.market-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.market-card-title {
    flex: 1;
}

.market-card-title h3 {
    color: var(--pm-text-primary);
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.market-resolve-explanation {
    color: var(--pm-text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    margin: -0.15rem 0 0.65rem 0;
    line-height: 1.25;
}

/* Resolve-source links: look like plain text, slight hover change */
.market-resolve-explanation a {
    color: inherit;
    text-decoration: none;
    font-weight: inherit;
    transition: color 180ms ease;
}

.market-resolve-explanation a:hover,
.market-resolve-explanation a:focus-visible {
    color: rgba(241, 245, 249, 0.95); /* subtle lift from --pm-text-secondary */
}

.prediction-type-badge {
    display: inline-block;
    background: var(--pm-gradient-1);
    color: var(--pm-text-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-badge.closed {
    background: rgba(239, 68, 68, 0.2);
    color: var(--pm-danger);
}

.status-badge.has-positions {
    background: rgba(16, 185, 129, 0.2);
    color: var(--pm-success);
}

/* Market Options */
.market-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.market-option {
    background: var(--pm-bg-dark);
    border: 1px solid var(--pm-border);
    border-radius: 10px;
    padding: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.user-stake-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--pm-success);
    color: white;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
    z-index: 10;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.6);
    }
}

.market-option::after {
    content: 'Click to predict';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--pm-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    z-index: 200;
}

.market-option:hover {
    border-color: var(--pm-primary);
    background: rgba(99, 102, 241, 0.1);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.market-option:hover::after {
    opacity: 0.9;
}

.market-option:active {
    transform: translateX(2px) scale(0.98);
}

.market-option.user-has-stake {
    border-color: var(--pm-success);
    background: rgba(16, 185, 129, 0.08);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.market-option.user-has-stake::after {
    content: 'Click to add more';
    background: var(--pm-success);
}

.market-option.user-has-stake:hover {
    border-color: var(--pm-success);
    background: rgba(16, 185, 129, 0.15);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.market-option.user-has-stake:hover::after {
    opacity: 0.95;
}

.market-card.closed .market-option {
    cursor: not-allowed;
    opacity: 0.6;
}

.market-card.closed .market-option::after {
    content: 'Market closed';
    background: var(--pm-danger);
}

/* Removed restriction - users can now bet on multiple options */

.option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}

.option-label {
    color: var(--pm-text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.option-percentage {
    color: var(--pm-primary);
    font-weight: 700;
    font-size: 1.25rem;
}

.market-option.user-selected .option-percentage {
    color: var(--pm-success);
}

/* Probability Bar Container */
.probability-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.probability-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--pm-success) 0%, var(--pm-primary) 50%, var(--pm-danger) 100%);
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideIn 0.8s ease-out;
}

.market-option.user-selected .probability-bar {
    background: var(--pm-success);
}

@keyframes slideIn {
    from {
        width: 0 !important;
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.option-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--pm-text-secondary);
    font-size: 0.8rem;
    position: relative;
    z-index: 1;
}

/* Reusable animation helpers */
.anim-section-in {
    animation: slideFadeInUpStrong 0.45s var(--pm-anim-ease);
}

.anim-tab-click {
    animation: clickPop var(--pm-anim-fast) ease-out;
}

.anim-card-in {
    opacity: 0;
    animation: slideFadeInUpStrong 0.45s var(--pm-anim-ease) forwards;
    animation-delay: var(--anim-delay, 0ms);
}

.anim-option-click {
    animation: clickPop 0.22s ease-out, rippleGlow 0.45s ease-out;
}

.anim-list-item-in {
    opacity: 0;
    animation: slideFadeInUpStrong 0.4s var(--pm-anim-ease) forwards;
    animation-delay: var(--anim-delay, 0ms);
}

.anim-quick-click,
.anim-button-press {
    animation: clickPop 0.18s ease-out;
}

/* Market Footer */
.market-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--pm-border);
}

.market-volume {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.volume-label {
    color: var(--pm-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.volume-value {
    color: var(--pm-text-primary);
    font-size: 0.95rem;
    font-weight: 700;
}

/* Portfolio Stats */
.portfolio-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-item {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid var(--pm-border);
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.stat-item:hover {
    border-color: var(--pm-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.2);
}

.stat-label {
    color: var(--pm-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    color: var(--pm-text-primary);
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-value.positive {
    color: var(--pm-success);
}

.stat-value.negative {
    color: var(--pm-danger);
}

/* Positions Container */
.positions-container {
    margin-top: 1.5rem;
}

.position-item {
    background: var(--pm-bg-card);
    border: 1px solid var(--pm-border);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.position-item:hover {
    border-color: var(--pm-border-light);
    transform: translateX(4px);
    box-shadow: var(--pm-shadow);
}

.position-item.won {
    border-left: 4px solid var(--pm-success);
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, var(--pm-bg-card) 5%);
}

.position-item.lost {
    border-left: 4px solid var(--pm-danger);
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.1) 0%, var(--pm-bg-card) 5%);
}

.position-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.position-header h4 {
    color: var(--pm-text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.position-date {
    color: var(--pm-text-secondary);
    font-size: 0.875rem;
}

.position-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.position-type {
    background: var(--pm-gradient-1);
    color: var(--pm-text-primary);
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.position-value {
    color: var(--pm-text-primary);
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 6px;
}

.position-stake,
.position-payout {
    color: var(--pm-text-secondary);
    font-size: 0.9rem;
}

.position-stake-total {
    color: var(--pm-text-primary);
    font-weight: 700;
    font-size: 1rem;
    background: rgba(99, 102, 241, 0.2);
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
}

.position-bet-count {
    color: var(--pm-text-secondary);
    font-size: 0.85rem;
    font-style: italic;
}

.position-profit {
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.position-profit.positive {
    color: var(--pm-success);
    background: rgba(16, 185, 129, 0.15);
}

.position-profit.negative {
    color: var(--pm-danger);
    background: rgba(239, 68, 68, 0.15);
}

.position-result {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--pm-border);
    color: var(--pm-text-secondary);
    font-size: 0.9rem;
}

/* Leaderboard */
.leaderboard-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.leaderboard-filters select {
    flex: 1;
    min-width: 150px;
    padding: 0.75rem 1rem;
    background: var(--pm-bg-card);
    border: 1px solid var(--pm-border);
    border-radius: 8px;
    color: var(--pm-text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.leaderboard-filters select:hover {
    border-color: var(--pm-primary);
}

.leaderboard-filters select:focus {
    outline: none;
    border-color: var(--pm-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.leaderboard-item {
    background: var(--pm-bg-card);
    border: 1px solid var(--pm-border);
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    border-color: var(--pm-primary);
    transform: translateX(4px);
    box-shadow: var(--pm-shadow);
}

.leaderboard-item:nth-child(1) {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, var(--pm-bg-card) 100%);
    border-color: #ffd700;
}

.leaderboard-item:nth-child(2) {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.15) 0%, var(--pm-bg-card) 100%);
    border-color: #c0c0c0;
}

.leaderboard-item:nth-child(3) {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.15) 0%, var(--pm-bg-card) 100%);
    border-color: #cd7f32;
}

.leaderboard-rank {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--pm-primary);
    min-width: 50px;
    text-align: center;
}

.leaderboard-username {
    color: var(--pm-text-primary);
    font-weight: 600;
    font-size: 1.1rem;
    flex: 1;
}

.leaderboard-stats {
    color: var(--pm-text-secondary);
    font-size: 0.9rem;
}

.leaderboard-profit {
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.leaderboard-profit.positive {
    color: var(--pm-success);
    background: rgba(16, 185, 129, 0.15);
}

.leaderboard-profit.negative {
    color: var(--pm-danger);
    background: rgba(239, 68, 68, 0.15);
}

/* Bet Confirmation Dialog */
.bet-dialog {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(12px);
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 99999 !important;
    animation: betDialogFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.bet-dialog[style*="display: none"] {
    display: none !important;
}

.bet-dialog[style*="display: block"] {
    display: flex !important;
}

@keyframes betDialogFadeIn {
    from { 
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to { 
        opacity: 1;
        backdrop-filter: blur(12px);
    }
}

.bet-dialog-content {
    background: var(--pm-bg-card) !important;
    border: 2px solid var(--pm-primary) !important;
    border-radius: 24px !important;
    width: 90% !important;
    max-width: 500px !important;
    padding: 2.5rem !important;
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.4), 0 0 0 1px rgba(99, 102, 241, 0.2) !important;
    position: relative !important;
    animation: betDialogScale 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: visible !important;
}

@keyframes betDialogScale {
    0% {
        transform: scale(0.8) rotate(-2deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.05) rotate(1deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.bet-dialog-header {
    text-align: center;
    margin-bottom: 2rem;
}

.bet-dialog-header h2 {
    color: var(--pm-text-primary);
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    background: var(--pm-gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bet-details {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    border: 1px solid var(--pm-border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.bet-details::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    animation: betDetailsPulse 3s ease-in-out infinite;
}

@keyframes betDetailsPulse {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.5; }
    50% { transform: scale(1.1) rotate(180deg); opacity: 0.8; }
}

.bet-show-title {
    color: var(--pm-text-primary);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.bet-prediction-info {
    position: relative;
    z-index: 1;
}

.bet-type-badge {
    display: inline-block;
    background: var(--pm-gradient-1);
    color: var(--pm-text-primary);
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.bet-choice {
    color: var(--pm-text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.5rem;
    text-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.bet-existing-stake {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    color: var(--pm-text-primary);
    font-size: 0.95rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.bet-existing-stake strong {
    color: var(--pm-success);
    font-weight: 700;
}

.bet-available-points {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    color: var(--pm-text-primary);
    font-size: 0.95rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.bet-available-points strong {
    color: var(--pm-primary);
    font-weight: 700;
}

.bet-available-points.points-low {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
}

.bet-available-points.points-low strong {
    color: var(--pm-warning);
}

.bet-available-points.points-zero {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
}

.bet-available-points.points-zero strong {
    color: var(--pm-danger);
}

.warning-text {
    display: block;
    margin-top: 0.5rem;
    color: var(--pm-danger);
    font-weight: 700;
    font-size: 0.85rem;
}

.bet-stake-input {
    margin-bottom: 2rem;
}

.bet-stake-input label {
    display: block;
    color: var(--pm-text-primary);
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.stake-input-row {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.stake-quick-btn {
    flex: 0 0 auto;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border: 2px solid var(--pm-border);
    border-radius: 12px;
    color: var(--pm-text-primary);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.stake-quick-btn:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.3) 100%);
    border-color: var(--pm-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.stake-quick-btn:active {
    transform: translateY(0);
}

.bet-stake-input input[type="number"] {
    flex: 1;
    padding: 1rem 1.25rem;
    background: var(--pm-bg-dark);
    border: 2px solid var(--pm-border);
    border-radius: 12px;
    color: var(--pm-text-primary);
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    min-width: 0;
}

.bet-stake-input input[type="number"]:focus {
    outline: none;
    border-color: var(--pm-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
    transform: scale(1.02);
}

.bet-confirmation-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.bet-confirm-btn,
.bet-cancel-btn {
    padding: 1.25rem;
    border: none;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.bet-confirm-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.bet-confirm-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.bet-confirm-btn:hover::before {
    width: 300px;
    height: 300px;
}

.bet-confirm-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.6);
}

.bet-confirm-btn:active {
    transform: translateY(-2px) scale(1.02);
}

.bet-cancel-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.bet-cancel-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.bet-cancel-btn:hover::before {
    width: 300px;
    height: 300px;
}

.bet-cancel-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 30px rgba(239, 68, 68, 0.6);
}

.bet-cancel-btn:active {
    transform: translateY(-2px) scale(1.02);
}

.btn-icon {
    font-size: 2.5rem;
    line-height: 1;
    position: relative;
    z-index: 1;
}

.btn-text {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .top-view {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dm-points-display {
        width: 100%;
        min-width: auto;
    }
    
    .points-value {
        font-size: 2rem;
    }
    
    .tab-navigation {
        grid-template-columns: 1fr;
    }
    
    .tab-btn {
        padding: 1.25rem;
    }
    
    .tab-icon {
        font-size: 2rem;
    }
    
    .list-grid {
        grid-template-columns: 1fr;
    }
    
    .market-card {
        padding: 1.25rem;
    }
    
    .market-card-title h3 {
        font-size: 1.05rem;
    }
    
    .prediction-type-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }
    
    .option-label {
        font-size: 0.875rem;
    }
    
    .option-percentage {
        font-size: 1.1rem;
    }
    
    .portfolio-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .leaderboard-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .leaderboard-filters {
        flex-direction: column;
    }
    
    .this-view-title {
        font-size: 2rem;
    }
    
    .bet-dialog-content {
        padding: 2rem !important;
    }
    
    .bet-dialog-header h2 {
        font-size: 1.5rem;
    }
    
    .bet-confirmation-actions {
        grid-template-columns: 1fr;
    }
    
    .bet-show-title {
        font-size: 1.1rem;
    }
    
    .bet-choice {
        font-size: 1.3rem;
    }
    
    .stake-quick-btn {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .list-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .market-card {
        padding: 1rem;
    }
    
    .market-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .status-badge {
        align-self: flex-start;
    }
    
    .option-meta {
        font-size: 0.75rem;
    }
    
    .portfolio-stats {
        grid-template-columns: 1fr;
    }
    
    .bet-dialog-content {
        padding: 1.5rem !important;
    }
    
    .bet-dialog-header h2 {
        font-size: 1.3rem;
    }
    
    .btn-icon {
        font-size: 2rem;
    }
    
    .btn-text {
        font-size: 0.8rem;
    }
    
    .market-option::after {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
    
    .stake-input-row {
        flex-wrap: wrap;
    }
    
    .stake-quick-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        flex: 1 1 calc(50% - 0.375rem);
        min-width: 80px;
    }
    
    .bet-stake-input input[type="number"] {
        font-size: 1rem;
        flex: 1 1 100%;
    }
}

/* Scrollbar Styling */
.bet-dialog-content::-webkit-scrollbar {
    width: 8px;
}

.bet-dialog-content::-webkit-scrollbar-track {
    background: var(--pm-bg-dark);
}

.bet-dialog-content::-webkit-scrollbar-thumb {
    background: var(--pm-primary);
    border-radius: 4px;
}

.bet-dialog-content::-webkit-scrollbar-thumb:hover {
    background: var(--pm-primary-dark);
}

@keyframes gentle-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Apply to the path */
.led-flash {
    animation: gentle-pulse 2.5s infinite ease-in-out;
    fill: currentColor; /* Allows you to control color via CSS elsewhere */
}



/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .complete-page-wrapper * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* Mini Dashboard */
.mini-dashboard {
    position: fixed;
    bottom: -400px;
    right: 20px;
    width: 350px;
    background-color: var(--pm-bg-card);
    border: 2px solid var(--pm-border);
    border-radius: 8px;
    box-shadow: var(--pm-shadow-lg);
    transition: bottom 0.3s ease-in-out;
    z-index: 1000;
}

.mini-dashboard.active {
    bottom: 20px;
}

.mini-dashboard-content {
    display: flex;
    flex-direction: column;
}

.mini-dashboard-header {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--pm-border);
}

.mini-dashboard-minimize {
    background: none;
    border: none;
    color: var(--pm-text-primary);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    transition: opacity 0.2s;
}

.mini-dashboard-minimize:hover {
    opacity: 0.7;
}

.mini-dashboard-body {
    display: flex;
    gap: 12px;
    padding: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.mini-dashboard-body:hover {
    background-color: var(--pm-bg-card-hover);
}

.mini-dashboard-poster {
    width: 80px;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
}

.mini-dashboard-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mini-dashboard-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--pm-text-primary);
}

.mini-dashboard-show-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--pm-text-primary);
}

.mini-dashboard-cta {
    font-size: 13px;
    color: var(--pm-text-primary);
}

.mini-dashboard-recommendation {
    display: flex;
    flex-direction: column;
    padding: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-top: 1px solid var(--pm-border);
    text-decoration: none;
}

.mini-dashboard-recommendation:hover {
    background-color: var(--pm-bg-card-hover);
}

.mini-dashboard-recommendation-images {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.mini-dashboard-poster-left,
.mini-dashboard-poster-right {
    width: 80px;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
}

.mini-dashboard-arrow {
    width: 0;
    height: 0;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-left: 20px solid var(--pm-text-primary);
    opacity: 0.6;
}

.mini-dashboard-recommendation-text {
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
    color: var(--pm-text-primary);
    text-align: center;
}

.mini-dashboard-recommendation-text .highlight {
    font-style: italic;
    font-weight: 600;
}

.caret-down {
    width: 20px;
    height: 20px;
    position: relative;
}

.caret-down::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid var(--pm-text-primary);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Minimized button */
.mini-dashboard-minimized-btn {
    position: fixed;
    bottom: -60px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--pm-bg-card);
    border: 2px solid var(--pm-border);
    box-shadow: var(--pm-shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: bottom 0.3s ease-in-out, transform 0.2s;
    z-index: 1000;
}

.mini-dashboard-minimized-btn.active {
    bottom: 20px;
}

.mini-dashboard-minimized-btn:hover {
    transform: scale(1.1);
}

/* TV Icon */
.tv-icon {
    -webkit-mask-image: url('../icons/tv.svg');
    mask-image: url('../icons/tv.svg');
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: inline-block;
    background-color: var(--pm-primary);
}

.main-icon {
    width: 26px;
    height: 26px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .mini-dashboard {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
    }
    
    .mini-dashboard-minimized-btn {
        right: 20px;
    }
}

