/**
 * Score Keeper - Share & Viral Styles
 * Share modal, share card, achievements, and viral features
 */

/* ========================================
   Share Modal
   ======================================== */
.share-modal-overlay {
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.share-modal-overlay.show {
    opacity: 1;
}

.share-modal-content {
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
}

/* ========================================
   Share Card Preview
   ======================================== */
.share-card-preview {
    margin-bottom: 20px;
    border-radius: 16px;
    overflow: hidden;
}

.share-card-generated {
    background: linear-gradient(135deg, #0d3d1a 0%, #1a5c2e 100%);
    padding: 24px;
    text-align: center;
    color: #fff;
}

.share-card-header-gen {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 14px;
    letter-spacing: 2px;
    font-weight: 600;
}

.share-card-suit {
    font-size: 24px;
}

.share-card-teams {
    margin-bottom: 12px;
}

.share-card-winner {
    margin-bottom: 8px;
}

.team-name-share {
    display: block;
    font-size: 22px;
    font-weight: 700;
}

.winner-label {
    display: block;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin: 4px 0;
}

.share-card-loser .team-name-share {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
}

.share-card-score-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 16px 0;
}

.score-big {
    font-size: 48px;
    font-weight: 800;
}

.score-loser {
    color: rgba(255, 255, 255, 0.5);
}

.share-card-score-display .score-divider {
    font-size: 28px;
    color: rgba(255, 255, 255, 0.3);
}

.share-card-mvp {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
}

.mvp-label {
    color: rgba(255, 255, 255, 0.6);
}

.mvp-name {
    font-weight: 600;
    margin: 0 4px;
}

.mvp-stat {
    color: rgba(255, 255, 255, 0.6);
}

.share-card-achievements {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.achievement-badge {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #1a1a1a;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.share-card-meta {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 16px;
}

.share-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.share-card-qr {
    background: #fff;
    padding: 4px;
    border-radius: 4px;
}

.qr-image {
    display: block;
    width: 60px;
    height: 60px;
}

.share-card-watermark {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

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

/* ========================================
   Share Buttons Grid
   ======================================== */
.share-buttons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.share-btn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-btn-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.share-btn-item:active {
    transform: translateY(0);
}

.share-btn-item.loading {
    opacity: 0.6;
    pointer-events: none;
}

.share-btn-icon {
    font-size: 24px;
}

.share-btn-label {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.8;
}

/* ========================================
   Achievements Section
   ======================================== */
.share-achievements-section {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.share-achievements-section h4 {
    font-size: 14px;
    color: #ffd700;
    margin-bottom: 12px;
    text-align: center;
}

.share-achievements-list {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.share-achievement-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: 20px;
}

.share-achievement-item .achievement-icon {
    font-size: 18px;
}

.share-achievement-item .achievement-name {
    font-size: 12px;
    font-weight: 600;
}

/* ========================================
   Share Text Section
   ======================================== */
.share-text-section {
    margin-bottom: 16px;
}

.share-text-label {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}

.share-text-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
    resize: none;
}

/* ========================================
   Hashtag Suggestions
   ======================================== */
.hashtag-suggestions {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.hashtag-chip {
    background: rgba(102, 33, 165, 0.3);
    border: 1px solid rgba(102, 33, 165, 0.5);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    color: #c4b5fd;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hashtag-chip:hover {
    background: rgba(102, 33, 165, 0.5);
}

.hashtag-chip.copied {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.5);
    color: #81c784;
}

.hashtag-chip.copied::after {
    content: ' ✓';
}

/* ========================================
   Challenge Modal
   ======================================== */
.challenge-modal-content {
    text-align: center;
}

.challenge-modal-content h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.challenge-modal-content p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 16px;
}

.challenge-url-box {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.challenge-url-box input {
    flex: 1;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 12px;
}

.challenge-share-text {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.challenge-share-text p {
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    margin: 0;
}

/* ========================================
   Trash Talk Button
   ======================================== */
.trash-talk-btn {
    position: fixed;
    bottom: 100px;
    right: 20px;
    z-index: 100;
    padding: 12px 20px;
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(102, 33, 165, 0.4);
    animation: trashTalkPulse 2s ease-in-out infinite;
}

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

.trash-talk-btn:hover {
    animation: none;
    transform: scale(1.1);
}

/* ========================================
   Achievement Share Card (Full)
   ======================================== */
.achievement-share-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #ffd700;
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    max-width: 300px;
    margin: 0 auto;
}

.achievement-icon-large {
    font-size: 64px;
    margin-bottom: 16px;
}

.achievement-name-large {
    font-size: 24px;
    font-weight: 700;
    color: #ffd700;
    margin-bottom: 8px;
}

.achievement-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 16px;
}

.achievement-game {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

/* ========================================
   Social Proof Elements
   ======================================== */
.social-proof {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.social-proof-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

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

.counter-number {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.counter-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.recent-activity {
    text-align: center;
}

.recent-activity-item {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.recent-activity-item strong {
    color: #fff;
}

/* ========================================
   QR Code Styling
   ======================================== */
.qr-code-section {
    text-align: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-top: 16px;
}

.qr-code-section p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 8px;
}

.qr-code-large {
    width: 120px;
    height: 120px;
    background: #fff;
    padding: 8px;
    border-radius: 8px;
    display: inline-block;
}

/* ========================================
   Mobile Responsive
   ======================================== */
@media (max-width: 480px) {
    .share-modal-content {
        padding: 16px;
        max-height: 85vh;
    }

    .share-buttons-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .share-btn-item {
        padding: 10px 4px;
    }

    .share-btn-icon {
        font-size: 20px;
    }

    .share-btn-label {
        font-size: 9px;
    }

    .score-big {
        font-size: 36px;
    }

    .team-name-share {
        font-size: 18px;
    }

    .share-card-loser .team-name-share {
        font-size: 16px;
    }

    .trash-talk-btn {
        bottom: 80px;
        right: 12px;
        padding: 10px 16px;
        font-size: 14px;
    }

    .share-achievements-list {
        gap: 8px;
    }

    .share-achievement-item {
        padding: 6px 10px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .share-buttons-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .share-card-header-gen {
        font-size: 12px;
    }

    .share-card-suit {
        font-size: 20px;
    }
}

/* ========================================
   Share Success Animation
   ======================================== */
.share-success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.share-success-content {
    text-align: center;
    animation: popIn 0.4s ease;
}

.share-success-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.share-success-text {
    font-size: 20px;
    color: #fff;
    font-weight: 600;
}

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

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================================
   Victory Achievements Section
   ======================================== */
.victory-achievements {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.05));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

.achievements-title {
    font-size: 1.1rem;
    color: #ffd700;
    text-align: center;
    margin-bottom: 16px;
}

.achievements-grid {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.achievement-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 16px;
    border-radius: 12px;
    animation: achievementPop 0.5s ease backwards;
}

.achievement-item:nth-child(2) { animation-delay: 0.1s; }
.achievement-item:nth-child(3) { animation-delay: 0.2s; }
.achievement-item:nth-child(4) { animation-delay: 0.3s; }

@keyframes achievementPop {
    from {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

.achievement-item .icon {
    font-size: 28px;
}

.achievement-item .name {
    font-size: 12px;
    font-weight: 600;
    color: #ffd700;
}

/* ========================================
   QR Code Section (Victory)
   ======================================== */
.qr-code-section {
    text-align: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-top: 20px;
}

.qr-code-section p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 8px;
}

.qr-code-large {
    width: 120px;
    height: 120px;
    background: #fff;
    padding: 8px;
    border-radius: 8px;
    display: inline-block;
}

/* Hide QR for premium users (optional - can be useful) */
body.is-premium .qr-code-section {
    /* Keep visible - good for sharing */
}

/* ========================================
   Mid-Game Share Lead Button
   ======================================== */
.share-lead-container {
    text-align: center;
    margin: 16px 0;
}

.share-lead-btn {
    background: linear-gradient(135deg, #6621a5, #4a1878);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    animation: shareLeadPulse 2s ease-in-out infinite;
    box-shadow: 0 4px 20px rgba(102, 33, 165, 0.4);
}

@keyframes shareLeadPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 20px rgba(102, 33, 165, 0.4); }
    50% { transform: scale(1.03); box-shadow: 0 6px 25px rgba(102, 33, 165, 0.5); }
}

.share-lead-btn:hover {
    animation: none;
    transform: scale(1.05);
}

.share-lead-btn:active {
    transform: scale(0.98);
}

/* Show only when there's a big lead */
.share-lead-container.hidden {
    display: none;
}

/* ========================================
   Social Proof Animations
   ======================================== */
@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.recent-activity-item .activity-time {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
}

/* ========================================
   Confetti Animation (for achievements)
   ======================================== */
.confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100%) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}
