/* ==========================================
   SHARE MODAL - COMPLETE STYLES
   ========================================== */

/* ── Overlay ── */
.share-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 16px;
}

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

/* ── Modal card ── */
.share-modal-content {
    background: #1e1e2e;
    border-radius: 24px;
    padding: 0;
    max-width: 480px;
    width: 90%;
    position: relative;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: none;
}

.share-modal-content::-webkit-scrollbar {
    display: none;
}

/* ── Header ── */
.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px 20px;
}

.share-modal-header h3 {
    color: #ffffff !important;
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.3s ease;
    flex-shrink: 0;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* ── Tabs ── */
.tabs-container {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0 32px;
    gap: 8px;
}

.tab-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color 0.3s ease, border-color 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.tab-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.tab-btn.active {
    color: #ffffff;
    border-bottom-color: #667eea;
}

/* ── Tab panels ── */
.tab-content {
    display: none;
    padding: 28px 32px 32px;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* ── Social grid ── */
.social-icons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.social-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.social-icon-item:hover {
    transform: translateY(-5px);
}

.social-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: background 0.3s ease;
    background: rgba(255, 255, 255, 0.08);
}

.social-icon:hover {
    background: rgba(255, 255, 255, 0.15);
}

.social-label {
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
}

/* Platform colours */
.instagram { color: #E4405F; }
.twitter   { color: #1DA1F2; }
.facebook  { color: #1877F2; }
.tiktok    { color: #000000; background: #ffffff !important; }
.whatsapp  { color: #25D366; }
.linkedin  { color: #0A66C2; }
.discord   { color: #5865F2; }
.reddit    { color: #FF4500; }
.telegram  { color: #0088cc; }

/* ── Copy link ── */
.copy-link-section {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
    margin-top: 28px;
}

.copy-link-label {
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
}

.copy-link-container {
    display: flex;
    gap: 10px;
}

.link-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: background 0.3s ease, border-color 0.3s ease;
    min-width: 0; /* prevents overflow in flex */
}

.link-input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.copy-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.copy-btn.copied {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

/* ── Users tab ── */
.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px 12px 44px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: background 0.3s ease, border-color 0.3s ease;
    box-sizing: border-box;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

.users-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) rgba(255,255,255,0.05);
}

.users-list::-webkit-scrollbar {
    width: 6px;
}

.users-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.users-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    border: 1px solid transparent;
}

.user-item:last-child {
    margin-bottom: 0;
}

.user-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-item.selected {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.4);
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    margin-right: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.connection-user-name {
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-username {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    flex-shrink: 0;
    margin-left: 8px;
    position: relative;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.user-item.selected .user-checkbox {
    background: #667eea;
    border-color: #667eea;
}

.user-item.selected .user-checkbox::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 13px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
}

.send-btn {
    width: 100%;
    background: #667eea;
    border: none;
    border-radius: 12px;
    padding: 14px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.send-btn:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── QR tab ── */
.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.qr-code-wrapper {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* canvas rendered by QRious */
.qr-code-wrapper canvas,
.qr-code-wrapper img {
    display: block;
    width: 220px;
    height: 220px;
}

.qr-info {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.download-qr-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 24px;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.download-qr-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ── No results ── */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.no-results i {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
    opacity: 0.3;
}

/* ── Keyframes ── */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

/* ── Responsive ── */
@media (max-width: 480px) {
    .social-icons-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }

    .social-icon {
        width: 56px;
        height: 56px;
        font-size: 24px;
    }

    .social-label {
        font-size: 12px;
    }
}

@media (max-width: 375px) {
    .tab-btn         { padding: 12px 15px; }
    .tabs-container  { padding: 0 18px; gap: 8px; }
    .tab-content     { padding: 20px 18px 24px; }
    .share-modal-header { padding: 20px 18px 16px; }
    .social-icons-grid  { gap: 10px; }
    .social-icon     { width: 50px; height: 50px; }
    .copy-btn        { min-width: 40px; }
}

@media (max-width: 340px) {
    .copy-link-container { gap: 4px; }
    .copy-btn            { min-width: 35px; padding: 12px 10px; }
}
