/**
 * LinkCentre Games - Universal Share Modal Styles
 * Beautiful, consistent sharing experience
 */

/* Modal Container */
.game-share-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.game-share-modal.active {
    opacity: 1;
    visibility: visible;
}

/* Backdrop */
.game-share-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 40, 80, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Main Container */
.game-share-container {
    position: relative;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 24px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 
        0 25px 50px -12px rgba(0, 73, 143, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.game-share-modal.active .game-share-container {
    transform: translateY(0) scale(1);
}

/* Header */
.game-share-header {
    position: relative;
    padding: 32px 24px 20px;
    text-align: center;
    background: linear-gradient(135deg, #00498f 0%, #0066cc 50%, #1a7fd4 100%);
    border-radius: 24px 24px 0 0;
    overflow: hidden;
}

.game-share-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}

.game-share-header-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: bounce 0.6s ease-out;
}

@keyframes bounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.game-share-title {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.game-share-subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 0.95rem;
    margin: 0;
}

.game-share-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.game-share-close:hover {
    background: rgba(255,255,255,0.25);
    transform: rotate(90deg);
}

/* Preview Card */
.game-share-preview {
    padding: 20px 24px 0;
}

.share-preview-card {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4ff 100%);
    border: 2px solid #e0edff;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.share-preview-icon {
    font-size: 40px;
    flex-shrink: 0;
}

.share-preview-text {
    font-size: 0.95rem;
    color: #1e3a5f;
    line-height: 1.5;
    font-weight: 500;
}

/* Section Title */
.share-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 16px;
}

/* Share Platforms */
.game-share-platforms {
    padding: 24px 24px 0;
}

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

.share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    border: none;
    background: #f8fafc;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.share-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.5) 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.share-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px -4px rgba(0,0,0,0.15);
}

.share-btn:hover::before {
    opacity: 1;
}

.share-btn:active {
    transform: translateY(-2px);
}

.share-btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: transform 0.2s ease;
}

.share-btn:hover .share-btn-icon {
    transform: scale(1.1);
}

.share-btn-icon svg {
    width: 22px;
    height: 22px;
}

.share-btn-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    transition: color 0.2s ease;
}

/* Platform Colors */
.share-whatsapp { background: linear-gradient(135deg, #e8fdf0 0%, #d4f7e0 100%); }
.share-whatsapp .share-btn-icon { color: #25D366; }
.share-whatsapp:hover { background: linear-gradient(135deg, #25D366 0%, #128C7E 100%); }
.share-whatsapp:hover .share-btn-icon { color: white; }
.share-whatsapp:hover .share-btn-label { color: white; }

.share-twitter { background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%); }
.share-twitter .share-btn-icon { color: #000000; }
.share-twitter:hover { background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%); }
.share-twitter:hover .share-btn-icon { color: white; }
.share-twitter:hover .share-btn-label { color: white; }

.share-facebook { background: linear-gradient(135deg, #e8f0ff 0%, #d4e4ff 100%); }
.share-facebook .share-btn-icon { color: #1877F2; }
.share-facebook:hover { background: linear-gradient(135deg, #1877F2 0%, #0d5bc9 100%); }
.share-facebook:hover .share-btn-icon { color: white; }
.share-facebook:hover .share-btn-label { color: white; }

.share-telegram { background: linear-gradient(135deg, #e8f6ff 0%, #d4efff 100%); }
.share-telegram .share-btn-icon { color: #0088cc; }
.share-telegram:hover { background: linear-gradient(135deg, #0088cc 0%, #006699 100%); }
.share-telegram:hover .share-btn-icon { color: white; }
.share-telegram:hover .share-btn-label { color: white; }

.share-linkedin { background: linear-gradient(135deg, #e8f4ff 0%, #d4ebff 100%); }
.share-linkedin .share-btn-icon { color: #0A66C2; }
.share-linkedin:hover { background: linear-gradient(135deg, #0A66C2 0%, #004182 100%); }
.share-linkedin:hover .share-btn-icon { color: white; }
.share-linkedin:hover .share-btn-label { color: white; }

.share-email { background: linear-gradient(135deg, #fff8e8 0%, #fff0d4 100%); }
.share-email .share-btn-icon { color: #f59e0b; }
.share-email:hover { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.share-email:hover .share-btn-icon { color: white; }
.share-email:hover .share-btn-label { color: white; }

.share-messenger { background: linear-gradient(135deg, #f0e8ff 0%, #e4d4ff 100%); }
.share-messenger .share-btn-icon { color: #0099FF; }
.share-messenger:hover { background: linear-gradient(135deg, #0099FF 0%, #006aff 100%); }
.share-messenger:hover .share-btn-icon { color: white; }
.share-messenger:hover .share-btn-label { color: white; }

.share-reddit { background: linear-gradient(135deg, #ffe8e8 0%, #ffd4d4 100%); }
.share-reddit .share-btn-icon { color: #FF4500; }
.share-reddit:hover { background: linear-gradient(135deg, #FF4500 0%, #cc3700 100%); }
.share-reddit:hover .share-btn-icon { color: white; }
.share-reddit:hover .share-btn-label { color: white; }

/* Divider */
.game-share-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
}

.game-share-divider::before,
.game-share-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
}

.game-share-divider span {
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Copy Section */
.game-share-copy {
    padding: 0 24px;
}

.copy-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e3a5f;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    border-color: #00498f;
    background: #f0f7ff;
    color: #00498f;
}

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

.copy-btn.copied {
    border-color: #10b981;
    background: #d1fae5;
    color: #059669;
}

.copy-btn svg {
    flex-shrink: 0;
}

/* Native Share */
.game-share-native {
    padding: 20px 24px 0;
    display: none;
}

.game-share-native.show {
    display: block;
}

.native-share-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    border: none;
    background: linear-gradient(135deg, #ffc107 0%, #ffda6a 100%);
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e3a5f;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(255,193,7,0.3);
}

.native-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255,193,7,0.4);
}

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

/* Footer */
.game-share-footer {
    padding: 20px 24px 24px;
    text-align: center;
}

.game-share-footer p {
    margin: 0;
    color: #64748b;
    font-size: 0.85rem;
}

.game-share-footer a {
    color: #00498f;
    font-weight: 600;
    text-decoration: none;
}

.game-share-footer a:hover {
    text-decoration: underline;
}

/* Toast Notification */
.game-share-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.4);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.game-share-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.game-share-toast svg {
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 520px) {
    .game-share-modal {
        padding: 0;
        align-items: flex-end;
    }
    
    .game-share-container {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
    }
    
    .game-share-modal.active .game-share-container {
        transform: translateY(0);
    }
    
    .share-buttons-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .share-btn {
        padding: 12px 6px;
    }
    
    .share-btn-icon {
        width: 28px;
        height: 28px;
    }
    
    .share-btn-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .share-btn-label {
        font-size: 0.65rem;
    }
    
    .copy-options {
        grid-template-columns: 1fr;
    }
    
    .game-share-header {
        padding: 28px 20px 16px;
    }
    
    .game-share-title {
        font-size: 1.3rem;
    }
    
    .game-share-platforms,
    .game-share-copy,
    .game-share-native,
    .game-share-footer,
    .game-share-preview {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* Animation for opening from victory screen */
@keyframes shareModalPop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.game-share-modal.active .game-share-container {
    animation: shareModalPop 0.4s ease-out forwards;
}

/* Confetti effect on open */
.game-share-header.confetti::after {
    content: '🎊';
    position: absolute;
    font-size: 24px;
    animation: confettiFall 1s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        top: 0;
        opacity: 1;
        transform: rotate(0deg) scale(0);
    }
    50% {
        opacity: 1;
        transform: rotate(180deg) scale(1.5);
    }
    100% {
        top: 100%;
        opacity: 0;
        transform: rotate(360deg) scale(1);
    }
}

/* Scrollbar styling */
.game-share-container::-webkit-scrollbar {
    width: 6px;
}

.game-share-container::-webkit-scrollbar-track {
    background: transparent;
}

.game-share-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.game-share-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
