/**
 * CanvasClashes - Shareable Result Cards Design System
 * Ultra-premium dark glassmorphism, glowing accents & micro-animations
 */

:root {
    --cc-card-bg: #090d16;
    --cc-card-panel: rgba(15, 23, 42, 0.85);
    --cc-card-border: rgba(255, 255, 255, 0.12);
    --cc-cyan: #00f5ff;
    --cc-purple: #a855f7;
    --cc-gold: #f59e0b;
    --cc-pink: #ec4899;
    --cc-green: #10b981;
}

/* Modal Backdrop */
.cc-share-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 7, 15, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.cc-share-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Dialog */
.cc-share-dialog {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(9, 13, 22, 0.98));
    border: 1px solid rgba(0, 245, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(0, 245, 255, 0.15);
    width: 100%;
    max-width: 820px;
    max-height: 92vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.cc-share-backdrop.active .cc-share-dialog {
    transform: scale(1) translateY(0);
}

/* Header */
.cc-share-header {
    padding: 1.25rem 1.5rem 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cc-share-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cc-share-title-icon {
    font-size: 1.6rem;
    filter: drop-shadow(0 0 8px rgba(0, 245, 255, 0.5));
}

.cc-share-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #ffffff 30%, #00f5ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cc-share-subtitle {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 2px;
}

.cc-share-close-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cc-share-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ffffff;
    transform: rotate(90deg);
}

/* Body */
.cc-share-body {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Canvas Card Preview Container */
.cc-card-preview-wrapper {
    position: relative;
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: #000;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 245, 255, 0.1);
    aspect-ratio: 1200 / 630;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cc-card-canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.cc-card-generating-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(9, 13, 22, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: #00f5ff;
    font-weight: 700;
    font-size: 0.95rem;
    transition: opacity 0.3s ease;
}

.cc-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(0, 245, 255, 0.2);
    border-top-color: #00f5ff;
    border-radius: 50%;
    animation: ccSpin 0.8s linear infinite;
}

@keyframes ccSpin {
    to { transform: rotate(360deg); }
}

/* Primary Action Buttons */
.cc-share-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.cc-btn-share-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border: none;
    text-decoration: none;
    color: #ffffff;
    user-select: none;
}

.cc-btn-share-download {
    background: linear-gradient(135deg, #00f5ff, #0284c7);
    box-shadow: 0 4px 15px rgba(0, 245, 255, 0.3);
}

.cc-btn-share-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 245, 255, 0.5);
}

.cc-btn-share-copy {
    background: linear-gradient(135deg, #a855f7, #6366f1);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.cc-btn-share-copy:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.5);
}

.cc-btn-share-native {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.cc-btn-share-native:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5);
}

.cc-btn-share-duel {
    background: linear-gradient(135deg, #ec4899, #be185d);
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
}

.cc-btn-share-duel:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.5);
}

/* Social Quick Channels */
.cc-social-channels-bar {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.cc-social-channels-label {
    font-size: 0.82rem;
    color: #94a3b8;
    font-weight: 600;
}

.cc-social-icons-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cc-social-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cc-social-btn:hover {
    transform: translateY(-2px) scale(1.05);
}

.cc-social-whatsapp { background: #25D366; }
.cc-social-telegram { background: #0088cc; }
.cc-social-facebook { background: #1877F2; }
.cc-social-twitter  { background: #000000; border-color: #333; }
.cc-social-viber    { background: #7360F2; }

/* Custom Toast for Card Actions */
.cc-share-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid #00f5ff;
    color: #ffffff;
    padding: 0.65rem 1.4rem;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 245, 255, 0.3);
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 100050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

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

/* Responsive */
@media (max-width: 640px) {
    .cc-share-dialog {
        border-radius: 16px;
        max-height: 95vh;
    }
    .cc-share-header {
        padding: 1rem;
    }
    .cc-share-body {
        padding: 1rem;
        gap: 1rem;
    }
    .cc-share-actions-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    .cc-btn-share-action {
        font-size: 0.82rem;
        padding: 0.65rem 0.75rem;
    }
    .cc-social-channels-bar {
        justify-content: center;
    }
}
