/**
 * Quiz Share Modal — Redesigned
 * Matches Qfunny brand: #7F77DD, #1a1a2e, #1D9E75
 * Location: /components/quiz/player/share.css
 */

/* ── Share button in sidebar topbar ── */
.qps-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 7px;
    color: rgba(255,255,255,0.85);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.qps-share-btn:hover {
    background: rgba(255,255,255,0.18);
    color: #fff;
    border-color: rgba(255,255,255,0.35);
}

/* ── Modal backdrop ── */
.share-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.share-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
}

/* ── Modal box ── */
.share-modal-content {
    position: relative;
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.22);
    overflow: hidden;
    animation: smSlideIn .22s ease;
}

@keyframes smSlideIn {
    from { opacity: 0; transform: translateY(-14px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Modal header */
.share-modal-header {
    background: #1a1a2e;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.share-modal-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-modal-close {
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: rgba(255,255,255,0.6);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    line-height: 1;
}

.share-modal-close:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* Modal body */
.share-modal-body {
    padding: 20px;
}

/* ── Link section ── */
.share-link-section { margin-bottom: 18px; }

.share-link-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    margin: 0 0 7px;
}

.share-link-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 0 10px;
    transition: border-color .15s;
}

.share-link-container:focus-within { border-color: #7F77DD; }

.share-link-icon { color: #9ca3af; flex-shrink: 0; }

.share-link-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 12px;
    color: #374151;
    outline: none;
    height: 40px;
    font-family: 'Courier New', monospace;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-copy-link {
    height: 28px;
    padding: 0 14px;
    background: #7F77DD;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-copy-link:hover { background: #534AB7; }
.btn-copy-link.copied { background: #1D9E75; }

/* ── Social section ── */
.share-social-section { margin-bottom: 20px; }

.share-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    margin: 0 0 10px;
}

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

.btn-social {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 62px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    transition: all .15s;
    padding: 0;
}

.btn-social:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.btn-social i { font-size: 22px; }

/* Brand colours on hover */
.btn-social.facebook:hover { border-color: #1877F2; color: #1877F2; background: #EEF4FF; }
.btn-social.twitter:hover  { border-color: #000;    color: #000;    background: #f7f7f7; }
.btn-social.whatsapp:hover { border-color: #25D366; color: #25D366; background: #EDFFF3; }
.btn-social.linkedin:hover { border-color: #0A66C2; color: #0A66C2; background: #EEF6FF; }

/* ── QR code section ── */
.share-qr-section {
    border-top: 0.5px solid #f3f4f6;
    padding-top: 18px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.qr-code-container {
    width: 88px;
    height: 88px;
    flex-shrink: 0;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.qr-code-container img,
.qr-code-container canvas {
    width: 80px !important;
    height: 80px !important;
}

.share-qr-info { flex: 1; }

.share-qr-info p {
    font-size: 12px;
    color: #6b7280;
    margin: 0 0 8px;
    line-height: 1.5;
}

.btn-download-qr {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 12px;
    background: #f3f4f6;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: background .15s;
}

.btn-download-qr:hover { background: #e5e7eb; }

/* ── Responsive ── */
@media (max-width: 480px) {
    .share-modal-content { border-radius: 12px; }
    .share-social-buttons { grid-template-columns: repeat(4, 1fr); gap: 6px; }
    .btn-social { height: 54px; font-size: 10px; }
    .btn-social i { font-size: 18px; }
    .share-qr-section { flex-direction: column; align-items: flex-start; }
}
