/* shareCard.css - Share card button and modal styles */

/* Share button in game card */
.share-game-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background-color: #3498db;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.share-game-btn:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.share-game-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.share-game-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

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

/* Share row in game card */
.game-card-share-row {
    display: flex;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px dashed #e9ecef;
    margin-top: 12px;
}

/* Share modal overlay */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

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

.share-modal {
    background-color: #ffffff;
    border-radius: 12px;
    max-width: 680px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #2c3e50;
    color: #ffffff;
}

.share-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.share-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #ffffff;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s, transform 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.share-modal-close:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.1);
}

.share-modal-preview {
    padding: 24px;
    background-color: #f8f9fa;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
    min-height: 200px;
}

.share-preview-loading {
    color: #666;
    font-size: 0.9rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.share-modal-preview canvas {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: none; /* Hidden until loaded */
}

.share-modal-actions {
    display: flex;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
    justify-content: center;
    background-color: #ffffff;
}

.share-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 170px;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.share-action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.share-action-btn svg {
    flex-shrink: 0;
}

.share-download {
    background-color: #e74c3c;
    color: #ffffff;
}

.share-download:hover:not(:disabled) {
    background-color: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.share-twitter {
    background-color: #000000;
    color: #ffffff;
}

.share-twitter:hover:not(:disabled) {
    background-color: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.share-native {
    background-color: #28a745;
    color: #ffffff;
}

.share-native:hover:not(:disabled) {
    background-color: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .share-modal-overlay {
        padding: 10px;
        align-items: flex-end;
    }

    .share-modal {
        max-width: 100%;
        max-height: 85vh;
        border-radius: 16px 16px 0 0;
    }

    .share-modal-preview {
        padding: 16px;
    }

    .share-modal-actions {
        flex-direction: column;
        padding: 16px;
        gap: 10px;
    }

    .share-action-btn {
        width: 100%;
        padding: 16px 20px;
    }

    .game-card-share-row {
        justify-content: center;
    }

    .share-game-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 18px;
    }
}

@media (max-width: 480px) {
    .share-modal-header h3 {
        font-size: 1.1rem;
    }

    .share-action-btn {
        font-size: 0.9rem;
        padding: 14px 16px;
    }
}
