/**
 * Score Keeper - Premium Styles
 * Etsy bar, upsell modals, theme selector, premium badges
 */

/* ========================================
   Etsy Redemption Bar
   ======================================== */
.etsy-bar {
    background: linear-gradient(135deg, #6621a5 0%, #4a1878 100%);
    padding: 12px 16px;
    position: relative;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(102, 33, 165, 0.3);
}

.etsy-bar-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    max-width: 800px;
    margin: 0 auto;
}

.etsy-bar-text {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
}

.etsy-bar-input-group {
    display: flex;
    gap: 8px;
}

.etsy-bar-input {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 8px 12px;
    color: #fff;
    font-size: 0.9rem;
    width: 140px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.etsy-bar-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    text-transform: none;
    letter-spacing: normal;
}

.etsy-bar-input:focus {
    outline: none;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.2);
}

.etsy-bar-btn {
    background: #fff;
    color: #6621a5;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.etsy-bar-btn:hover {
    background: #f0e6ff;
    transform: translateY(-1px);
}

.etsy-bar-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.etsy-bar-close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.etsy-bar-close:hover {
    color: #fff;
}

.etsy-bar-message {
    width: 100%;
    text-align: center;
    padding: 8px;
    margin-top: 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.etsy-bar-message.success {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
}

.etsy-bar-message.error {
    background: rgba(244, 67, 54, 0.2);
    color: #ef9a9a;
}

/* Collapsed state */
.etsy-bar.collapsed {
    padding: 8px 16px;
}

.etsy-bar.collapsed .etsy-bar-input-group,
.etsy-bar.collapsed .etsy-bar-close {
    display: none;
}

.etsy-bar.collapsed .etsy-bar-text {
    cursor: pointer;
}

.etsy-bar.collapsed .etsy-bar-text::after {
    content: ' Click to redeem →';
    opacity: 0.7;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .etsy-bar {
        padding: 10px 12px;
    }

    .etsy-bar-content {
        flex-direction: column;
        gap: 10px;
    }

    .etsy-bar-text {
        font-size: 0.8rem;
        text-align: center;
    }

    .etsy-bar-input {
        width: 120px;
        padding: 10px 12px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .etsy-bar-btn {
        padding: 10px 20px;
    }

    .etsy-bar-close {
        right: 8px;
        top: 8px;
        transform: none;
    }
}

/* ========================================
   Premium Upsell Modal
   ======================================== */
.premium-upsell-modal {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.premium-upsell-modal.show {
    opacity: 1;
}

.premium-upsell-content {
    max-width: 420px;
    text-align: center;
    padding: 32px 24px;
}

.upsell-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: upsellBounce 1s ease infinite;
}

@keyframes upsellBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.upsell-title {
    font-size: 1.75rem;
    color: #fff;
    margin-bottom: 12px;
}

.upsell-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.upsell-preview {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.upsell-price {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
}

.price-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.price-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

.upsell-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    text-align: left;
    margin-bottom: 24px;
    padding: 0 16px;
}

.upsell-feature {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.upsell-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.upsell-etsy {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.btn-link {
    background: none;
    border: none;
    color: #a78bfa;
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
}

.btn-link:hover {
    color: #c4b5fd;
}

/* Mobile upsell */
@media (max-width: 480px) {
    .premium-upsell-content {
        padding: 24px 16px;
    }

    .upsell-features {
        grid-template-columns: 1fr;
    }

    .upsell-icon {
        font-size: 3rem;
    }

    .upsell-title {
        font-size: 1.5rem;
    }

    .price-amount {
        font-size: 2rem;
    }
}

/* ========================================
   Premium Badge
   ======================================== */
.premium-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 0.75rem;
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #1a1a1a;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: badgeGlow 2s ease-in-out infinite;
}

@keyframes badgeGlow {
    0%, 100% { box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 2px 12px rgba(255, 215, 0, 0.5); }
}

/* Premium indicator in header */
.premium-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #6621a5, #4a1878);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.premium-indicator::before {
    content: '⭐';
}

/* ========================================
   Theme Selector
   ======================================== */
.theme-selector {
    margin-bottom: 24px;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.theme-card {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.theme-card:hover {
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.theme-card.active {
    border-color: var(--accent-color);
    box-shadow: 0 0 12px rgba(102, 33, 165, 0.4);
}

.theme-card.locked {
    opacity: 0.7;
}

.theme-card.locked::after {
    content: '🔒';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 1rem;
}

.theme-preview {
    width: 100%;
    height: 60px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.theme-name {
    font-size: 0.8rem;
    color: #fff;
    text-align: center;
    font-weight: 500;
}

.theme-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: linear-gradient(135deg, #6621a5, #4a1878);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
}

/* Theme Previews */
.theme-preview.classic-green {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
}

.theme-preview.casino-red {
    background: linear-gradient(135deg, #8b0000 0%, #b22222 100%);
}

.theme-preview.blue-diamond {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
}

.theme-preview.vegas-gold {
    background: linear-gradient(135deg, #b8860b 0%, #daa520 100%);
}

.theme-preview.backyard-wood {
    background: linear-gradient(135deg, #5d4037 0%, #795548 100%);
}

.theme-preview.grandma-kitchen {
    background: repeating-linear-gradient(
        45deg,
        #f5f5f5,
        #f5f5f5 10px,
        #e0e0e0 10px,
        #e0e0e0 20px
    );
}

.theme-preview.midnight-black {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.theme-preview.neon-glow {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0a2e 100%);
    border: 1px solid #ff00ff;
    box-shadow: inset 0 0 20px rgba(255, 0, 255, 0.3);
}

/* ========================================
   Table Themes (Body Classes)
   ======================================== */

/* Casino Red Velvet */
body.theme-casino-red {
    --felt-color: #8b0000;
    --felt-light: #b22222;
    --felt-dark: #5c0000;
    background: linear-gradient(135deg, var(--felt-dark) 0%, var(--felt-color) 50%, var(--felt-light) 100%);
}

/* Blue Diamond */
body.theme-blue-diamond {
    --felt-color: #1a237e;
    --felt-light: #3949ab;
    --felt-dark: #0d1442;
    background: linear-gradient(135deg, var(--felt-dark) 0%, var(--felt-color) 50%, var(--felt-light) 100%);
}

/* Vegas Gold */
body.theme-vegas-gold {
    --felt-color: #b8860b;
    --felt-light: #daa520;
    --felt-dark: #8b6914;
    background: linear-gradient(135deg, var(--felt-dark) 0%, var(--felt-color) 50%, var(--felt-light) 100%);
}

body.theme-vegas-gold .card,
body.theme-vegas-gold .team-card,
body.theme-vegas-gold .player-bid-card {
    border-color: rgba(255, 215, 0, 0.3);
}

/* Backyard BBQ Wood */
body.theme-backyard-wood {
    --felt-color: #5d4037;
    --felt-light: #8d6e63;
    --felt-dark: #3e2723;
    background: linear-gradient(135deg, var(--felt-dark) 0%, var(--felt-color) 50%, var(--felt-light) 100%);
}

/* Grandma's Kitchen (Tablecloth) */
body.theme-grandma-kitchen {
    --felt-color: #f5f5f5;
    --felt-light: #fff;
    --felt-dark: #e0e0e0;
    background: repeating-linear-gradient(
        45deg,
        #fff,
        #fff 20px,
        #f5deb3 20px,
        #f5deb3 40px
    );
}

body.theme-grandma-kitchen,
body.theme-grandma-kitchen .text-secondary,
body.theme-grandma-kitchen .text-muted {
    color: #333;
}

body.theme-grandma-kitchen .card,
body.theme-grandma-kitchen .team-card,
body.theme-grandma-kitchen .player-bid-card {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

body.theme-grandma-kitchen .btn-primary {
    background: #8b4513;
}

/* Midnight Black */
body.theme-midnight-black {
    --felt-color: #1a1a1a;
    --felt-light: #333;
    --felt-dark: #000;
    background: linear-gradient(135deg, var(--felt-dark) 0%, var(--felt-color) 50%, var(--felt-light) 100%);
}

body.theme-midnight-black .card,
body.theme-midnight-black .team-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Neon Glow */
body.theme-neon-glow {
    --felt-color: #0a0a0a;
    --felt-light: #1a0a2e;
    --felt-dark: #000;
    --accent-color: #ff00ff;
    background: linear-gradient(135deg, var(--felt-dark) 0%, var(--felt-color) 50%, var(--felt-light) 100%);
}

body.theme-neon-glow .card,
body.theme-neon-glow .team-card,
body.theme-neon-glow .player-bid-card {
    border: 1px solid rgba(255, 0, 255, 0.4);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.2);
}

body.theme-neon-glow .btn-primary {
    background: linear-gradient(135deg, #ff00ff, #00ffff);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
}

body.theme-neon-glow .btn-accent {
    background: linear-gradient(135deg, #00ffff, #ff00ff);
}

body.theme-neon-glow .corner-suit {
    text-shadow: 0 0 20px currentColor;
}

/* ========================================
   Premium Stats Dashboard
   ======================================== */
.stats-dashboard {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.stats-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.stats-dashboard-title {
    font-size: 1.25rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-dashboard-title::before {
    content: '📊';
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Highlight stats */
.stat-card.highlight {
    background: linear-gradient(135deg, rgba(102, 33, 165, 0.3), rgba(102, 33, 165, 0.1));
    border: 1px solid rgba(102, 33, 165, 0.5);
}

.stat-card.highlight .stat-value {
    color: #a78bfa;
}

/* Locked stats overlay */
.stats-locked-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    z-index: 10;
}

.stats-locked-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.stats-locked-text {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 16px;
}

/* ========================================
   Locked Feature Styles
   ======================================== */
.premium-locked {
    position: relative;
    pointer-events: none;
}

.premium-locked::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 5;
    border-radius: inherit;
}

.premium-locked::after {
    content: '🔒 Premium';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(102, 33, 165, 0.9);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 6;
    pointer-events: auto;
    cursor: pointer;
}

/* ========================================
   Share Watermark
   ======================================== */
.share-watermark {
    position: absolute;
    bottom: 12px;
    right: 12px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 8px;
    border-radius: 4px;
}

/* Premium share - no watermark */
body.is-premium .share-watermark {
    display: none;
}

/* ========================================
   Export Button
   ======================================== */
.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.export-btn::before {
    content: '📥';
}

.export-btn.locked::after {
    content: '🔒';
    margin-left: 4px;
}

/* ========================================
   Settings Panel Premium Section
   ======================================== */
.settings-premium-section {
    background: linear-gradient(135deg, rgba(102, 33, 165, 0.2), rgba(102, 33, 165, 0.05));
    border: 1px solid rgba(102, 33, 165, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}

.settings-premium-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    color: #a78bfa;
    margin-bottom: 12px;
}

.settings-premium-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.settings-premium-status.active {
    background: rgba(76, 175, 80, 0.2);
}

.settings-premium-status.active::before {
    content: '✓';
    color: #4caf50;
}

/* ========================================
   Share Premium Upsell
   ======================================== */
.share-premium-upsell {
    background: linear-gradient(135deg, rgba(102, 33, 165, 0.3), rgba(102, 33, 165, 0.1));
    border: 1px solid rgba(102, 33, 165, 0.4);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.share-upsell-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.share-upsell-text {
    color: #c4b5fd;
    font-size: 0.9rem;
}

/* Hide upsell for premium users */
body.is-premium .share-premium-upsell {
    display: none;
}

/* Hide watermark in share card for premium */
body.is-premium .share-card-watermark {
    display: none;
}

/* Premium share card styling */
body.is-premium .share-card {
    border: 2px solid rgba(255, 215, 0, 0.3);
}

/* Share card watermark positioning */
.share-card {
    position: relative;
}

.share-card-watermark {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========================================
   Victory Watermark
   ======================================== */
.victory-container .watermark {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 24px;
}

body.is-premium .victory-container .watermark {
    display: none;
}

/* ========================================
   Premium Mobile Adjustments
   ======================================== */
@media (max-width: 480px) {
    .share-upsell-content {
        flex-direction: column;
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stats-locked-overlay {
        padding: 20px;
    }

    .stats-locked-text {
        font-size: 0.9rem;
    }
}
