/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    /* Darker backdrop */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    align-items: center;
    /* Center on desktop */
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--surface);
    border-radius: 1.5rem;
    width: 100%;
    max-width: 480px;
    /* Slightly wider */
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    /* Big shadow */
    border: 1px solid var(--border);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.active .modal-content {
    transform: scale(1);
}

/* Mobile specific: Bottom Sheet style */
@media (max-width: 600px) {
    .modal {
        align-items: flex-end;
        /* Align to bottom */
        padding: 0;
    }

    .modal-content {
        max-width: 100%;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        max-height: 90vh;
    }

    .modal.active .modal-content {
        transform: translateY(0);
        margin-bottom: 0;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.modal-close {
    background: #2a2b32;
    /* surface highlight */
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

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

.modal-body {
    padding: 1.5rem;
}

.share-section {
    margin-bottom: 2rem;
}

.share-section h4 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-tertiary);
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}

.friends-share-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.friend-share-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-color);
    /* Contrast inside modal */
    border: 1px solid transparent;
    border-radius: var(--radius);
    transition: border-color 0.2s;
}

.friend-share-item:hover {
    border-color: var(--border);
}

.friend-share-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.friend-share-info span {
    font-weight: 500;
    color: var(--text-primary);
}

.friend-share-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
}

.btn-secondary {
    width: 100%;
    background: var(--bg-color);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--surface-highlight);
    border-color: var(--text-tertiary);
}

.btn-share {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-share.shared {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-share:not(.shared) {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3);
}

.btn-share:not(.shared):active {
    transform: scale(0.95);
}